/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Console
NameSizeModeActions
Command/-0755rm
Exception/-0755rm
TestSuite/-0755rm
Arguments.php39260644editdlrm
BaseCommand.php85150644editdlrm
Command.php1420644editdlrm
CommandCollection.php74910644editdlrm
CommandCollectionAwareInterface.php10270644editdlrm
CommandFactory.php19790644editdlrm
CommandFactoryInterface.php10010644editdlrm
CommandInterface.php16980644editdlrm
CommandRunner.php126430644editdlrm
CommandScanner.php48430644editdlrm
composer.json11730644editdlrm
ConsoleErrorHandler.php1890644editdlrm
ConsoleInput.php28530644editdlrm
ConsoleInputArgument.php55680644editdlrm
ConsoleInputOption.php89290644editdlrm
ConsoleInputSubcommand.php39340644editdlrm
ConsoleIo.php215160644editdlrm
ConsoleOptionParser.php315660644editdlrm
ConsoleOutput.php100000644editdlrm
Helper.php17050644editdlrm
HelperRegistry.php32650644editdlrm
HelpFormatter.php73140644editdlrm
LICENSE.txt12040644editdlrm
README.md34650644editdlrm
Shell.php293710644editdlrm
ShellDispatcher.php121610644editdlrm
TaskRegistry.php29310644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php (5568B)
*/ protected $_choices; /** * Make a new Input Argument * * @param array|string $name The long name of the option, or an array with all the properties. * @param string $help The help text for this option * @param bool $required Whether this argument is required. Missing required args will trigger exceptions * @param array $choices Valid choices for this option. */ public function __construct($name, $help = '', $required = false, $choices = []) { if (is_array($name) && isset($name['name'])) { foreach ($name as $key => $value) { $this->{'_' . $key} = $value; } } else { /** @psalm-suppress PossiblyInvalidPropertyAssignmentValue */ $this->_name = $name; $this->_help = $help; $this->_required = $required; $this->_choices = $choices; } } /** * Get the value of the name attribute. * * @return string Value of this->_name. */ public function name(): string { return $this->_name; } /** * Checks if this argument is equal to another argument. * * @param \Cake\Console\ConsoleInputArgument $argument ConsoleInputArgument to compare to. * @return bool */ public function isEqualTo(ConsoleInputArgument $argument): bool { return $this->name() === $argument->name() && $this->usage() === $argument->usage(); } /** * Generate the help for this argument. * * @param int $width The width to make the name of the option. * @return string */ public function help(int $width = 0): string { $name = $this->_name; if (strlen($name) < $width) { $name = str_pad($name, $width, ' '); } $optional = ''; if (!$this->isRequired()) { $optional = ' (optional)'; } if ($this->_choices) { $optional .= sprintf(' (choices: %s)', implode('|', $this->_choices)); } return sprintf('%s%s%s', $name, $this->_help, $optional); } /** * Get the usage value for this argument * * @return string */ public function usage(): string { $name = $this->_name; if ($this->_choices) { $name = implode('|', $this->_choices); } $name = '<' . $name . '>'; if (!$this->isRequired()) { $name = '[' . $name . ']'; } return $name; } /** * Check if this argument is a required argument * * @return bool */ public function isRequired(): bool { return $this->_required; } /** * Check that $value is a valid choice for this argument. * * @param string $value The choice to validate. * @return true * @throws \Cake\Console\Exception\ConsoleException */ public function validChoice(string $value): bool { if (empty($this->_choices)) { return true; } if (!in_array($value, $this->_choices, true)) { throw new ConsoleException( sprintf( '"%s" is not a valid value for %s. Please use one of "%s"', $value, $this->_name, implode(', ', $this->_choices) ) ); } return true; } /** * Append this arguments XML representation to the passed in SimpleXml object. * * @param \SimpleXMLElement $parent The parent element. * @return \SimpleXMLElement The parent with this argument appended. */ public function xml(SimpleXMLElement $parent): SimpleXMLElement { $option = $parent->addChild('argument'); $option->addAttribute('name', $this->_name); $option->addAttribute('help', $this->_help); $option->addAttribute('required', (string)(int)$this->isRequired()); $choices = $option->addChild('choices'); foreach ($this->_choices as $valid) { $choices->addChild('choice', $valid); } return $parent; } }