Differential D18156 Diff 43702 src/applications/config/option/PhabricatorApplicationConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorApplicationConfigOptions.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | switch ($option->getType()) { | ||||
if ($value !== true && | if ($value !== true && | ||||
$value !== false) { | $value !== false) { | ||||
throw new PhabricatorConfigValidationException( | throw new PhabricatorConfigValidationException( | ||||
pht( | pht( | ||||
"Option '%s' is of type bool, but value is not true or false.", | "Option '%s' is of type bool, but value is not true or false.", | ||||
$option->getKey())); | $option->getKey())); | ||||
} | } | ||||
break; | break; | ||||
case 'string': | |||||
if (!is_string($value)) { | |||||
throw new PhabricatorConfigValidationException( | |||||
pht( | |||||
"Option '%s' is of type string, but value is not a string.", | |||||
$option->getKey())); | |||||
} | |||||
break; | |||||
case 'class': | case 'class': | ||||
$symbols = id(new PhutilSymbolLoader()) | $symbols = id(new PhutilSymbolLoader()) | ||||
->setType('class') | ->setType('class') | ||||
->setAncestorClass($option->getBaseClass()) | ->setAncestorClass($option->getBaseClass()) | ||||
->setConcreteOnly(true) | ->setConcreteOnly(true) | ||||
->selectSymbolsWithoutLoading(); | ->selectSymbolsWithoutLoading(); | ||||
$names = ipull($symbols, 'name', 'name'); | $names = ipull($symbols, 'name', 'name'); | ||||
if (empty($names[$value])) { | if (empty($names[$value])) { | ||||
▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines |