Differential D16694 Diff 40188 src/applications/conduit/parametertype/ConduitStringParameterType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/parametertype/ConduitStringParameterType.php
<?php | <?php | ||||
final class ConduitStringParameterType | final class ConduitStringParameterType | ||||
extends ConduitParameterType { | extends ConduitParameterType { | ||||
protected function getParameterValue(array $request, $key) { | protected function getParameterValue(array $request, $key) { | ||||
$value = parent::getParameterValue($request, $key); | $value = parent::getParameterValue($request, $key); | ||||
return $this->parseStringValue($request, $key, $value); | |||||
if (!is_string($value)) { | |||||
$this->raiseValidationException( | |||||
$request, | |||||
$key, | |||||
pht('Expected string, got something else.')); | |||||
} | |||||
return $value; | |||||
} | } | ||||
protected function getParameterTypeName() { | protected function getParameterTypeName() { | ||||
return 'string'; | return 'string'; | ||||
} | } | ||||
protected function getParameterFormatDescriptions() { | protected function getParameterFormatDescriptions() { | ||||
return array( | return array( | ||||
Show All 11 Lines |