Differential D14766 Diff 35721 src/applications/conduit/parametertype/ConduitStringParameterType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/parametertype/ConduitStringParameterType.php
- This file was copied from src/applications/conduit/parametertype/ConduitEpochParameterType.php.
<?php | <?php | ||||
final class ConduitEpochParameterType | final class ConduitStringParameterType | ||||
extends ConduitListParameterType { | extends ConduitListParameterType { | ||||
protected function getParameterValue(array $request, $key) { | protected function getParameterValue(array $request, $key) { | ||||
$value = parent::getParameterValue($request, $key); | $value = parent::getParameterValue($request, $key); | ||||
if (!is_int($value)) { | if (!is_string($value)) { | ||||
$this->raiseValidationException( | $this->raiseValidationException( | ||||
$request, | $request, | ||||
$key, | $key, | ||||
pht('Expected integer, got something else.')); | pht('Expected string, got something else.')); | ||||
} | } | ||||
return $value; | return $value; | ||||
} | } | ||||
protected function getParameterTypeName() { | protected function getParameterTypeName() { | ||||
return 'epoch'; | return 'string'; | ||||
} | } | ||||
protected function getParameterFormatDescriptions() { | protected function getParameterFormatDescriptions() { | ||||
return array( | return array( | ||||
pht('Epoch timestamp, as an integer.'), | pht('A string.'), | ||||
); | ); | ||||
} | } | ||||
protected function getParameterExamples() { | protected function getParameterExamples() { | ||||
return array( | return array( | ||||
'["PHID-PROJ-1111"]', | '"papaya"', | ||||
'["backend"]', | |||||
'["PHID-PROJ-2222", "frontend"]', | |||||
); | ); | ||||
} | } | ||||
} | } |