/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Console
NameSizeModeActions
Command/-0755rm
Exception/-0755rm
Arguments.php38580644editdlrm
BaseCommand.php80360644editdlrm
Command.php1760644editdlrm
CommandCollection.php72110644editdlrm
CommandCollectionAwareInterface.php10220644editdlrm
CommandFactory.php14310644editdlrm
CommandFactoryInterface.php9960644editdlrm
CommandInterface.php16980644editdlrm
CommandRunner.php125360644editdlrm
CommandScanner.php48280644editdlrm
composer.json11730644editdlrm
ConsoleErrorHandler.php2340644editdlrm
ConsoleInput.php28750644editdlrm
ConsoleInputArgument.php54920644editdlrm
ConsoleInputOption.php81320644editdlrm
ConsoleInputSubcommand.php39040644editdlrm
ConsoleIo.php206420644editdlrm
ConsoleOptionParser.php303260644editdlrm
ConsoleOutput.php97170644editdlrm
Helper.php16750644editdlrm
HelperRegistry.php33460644editdlrm
HelpFormatter.php72160644editdlrm
README.md33210644editdlrm
Shell.php293530644editdlrm
ShellDispatcher.php122240644editdlrm
TaskRegistry.php30050644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Console/ConsoleInputArgument.php (5492B)
$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->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; } }