Changeset View
Changeset View
Standalone View
Standalone View
src/parser/argument/PhutilArgumentSpecification.php
Context not available. | |||||
} | } | ||||
private static function validateName($name) { | private static function validateName($name) { | ||||
if (!preg_match('/^[a-z0-9][a-z0-9-]*$/', $name)) { | if (!@preg_match('/^[a-z0-9][a-z0-9-]*$/', $name)) { | ||||
throw new PhutilArgumentSpecificationException( | throw new PhutilArgumentSpecificationException( | ||||
pht( | pht( | ||||
"Argument names may only contain a-z, 0-9 and -, and must be ". | "Argument names may only contain a-z, 0-9 and -, and must be ". | ||||
Context not available. | |||||
} | } | ||||
private static function validateShortAlias($alias) { | private static function validateShortAlias($alias) { | ||||
if (strlen($alias) !== 1) { | if (@strlen($alias) !== 1) { | ||||
throw new PhutilArgumentSpecificationException( | throw new PhutilArgumentSpecificationException( | ||||
pht( | pht( | ||||
"Argument short aliases must be exactly one character long. ". | "Argument short aliases must be exactly one character long. ". | ||||
"'%s' is invalid.", | "'%s' is invalid.", | ||||
$alias)); | $alias)); | ||||
} | } | ||||
if (!preg_match('/^[a-zA-Z0-9]$/', $alias)) { | if (!@preg_match('/^[a-zA-Z0-9]$/', $alias)) { | ||||
throw new PhutilArgumentSpecificationException( | throw new PhutilArgumentSpecificationException( | ||||
pht( | pht( | ||||
"Argument short aliases may only be in a-z, A-Z and 0-9. ". | "Argument short aliases may only be in a-z, A-Z and 0-9. ". | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0