Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/parametertype/ConduitEpochParameterType.php
<?php | <?php | ||||
final class ConduitEpochParameterType | final class ConduitEpochParameterType | ||||
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); | ||||
$value = $this->parseIntValue($request, $key, $value); | |||||
if (!is_int($value)) { | |||||
$this->raiseValidationException( | |||||
$request, | |||||
$key, | |||||
pht('Expected epoch timestamp as integer, got something else.')); | |||||
} | |||||
if ($value <= 0) { | if ($value <= 0) { | ||||
$this->raiseValidationException( | $this->raiseValidationException( | ||||
$request, | $request, | ||||
$key, | $key, | ||||
pht('Epoch timestamp must be larger than 0, got %d.', $value)); | pht('Epoch timestamp must be larger than 0, got %d.', $value)); | ||||
} | } | ||||
Show All 20 Lines |