Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/parametertype/ConduitIntParameterType.php
<?php | <?php | ||||
final class ConduitIntParameterType | final class ConduitIntParameterType | ||||
extends ConduitParameterType { | extends ConduitParameterType { | ||||
protected function getParameterValue(array $request, $key) { | protected function getParameterValue(array $request, $key, $strict) { | ||||
$value = parent::getParameterValue($request, $key); | $value = parent::getParameterValue($request, $key, $strict); | ||||
return $this->parseIntValue($request, $key, $value, $strict); | |||||
if (!is_int($value)) { | |||||
$this->raiseValidationException( | |||||
$request, | |||||
$key, | |||||
pht('Expected integer, got something else.')); | |||||
} | |||||
return $value; | |||||
} | } | ||||
protected function getParameterTypeName() { | protected function getParameterTypeName() { | ||||
return 'int'; | return 'int'; | ||||
} | } | ||||
protected function getParameterFormatDescriptions() { | protected function getParameterFormatDescriptions() { | ||||
return array( | return array( | ||||
Show All 13 Lines |