Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/parametertype/ConduitListParameterType.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (!$value && !$this->getAllowEmptyList()) { | ||||
$request, | $request, | ||||
$key, | $key, | ||||
pht('Expected a nonempty list, but value is an empty list.')); | pht('Expected a nonempty list, but value is an empty list.')); | ||||
} | } | ||||
return $value; | return $value; | ||||
} | } | ||||
protected function validateStringList(array $request, $key, array $list) { | protected function parseStringList(array $request, $key, array $list) { | ||||
foreach ($list as $idx => $item) { | foreach ($list as $idx => $item) { | ||||
if (!is_string($item)) { | $list[$idx] = $this->parseStringValue($request, $key.'['.$idx.']', $item); | ||||
$this->raiseValidationException( | |||||
$request, | |||||
$key, | |||||
pht( | |||||
'Expected a list of strings, but item with index "%s" is '. | |||||
'not a string.', | |||||
$idx)); | |||||
} | |||||
} | } | ||||
return $list; | return $list; | ||||
} | } | ||||
protected function getParameterDefault() { | protected function getParameterDefault() { | ||||
return array(); | return array(); | ||||
} | } | ||||
} | } |