diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php index d994d708f..f1506809b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php @@ -49,19 +49,19 @@ class ResultCommand extends Console\Command\Command ->setDescription('Clear result cache of the various cache drivers.') ->setDefinition(array( new InputOption( - 'id', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'id', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'ID(s) of the cache entry to delete (accepts * wildcards).', array() ), new InputOption( - 'regex', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'regex', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Delete cache entries that match the given regular expression(s).', array() ), new InputOption( - 'prefix', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'prefix', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Delete cache entries that have the given prefix(es).', array() ), new InputOption( - 'suffix', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'suffix', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Delete cache entries that have the given suffix(es).', array() ), )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index a518b76e8..1a1328aac 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -112,16 +112,16 @@ class ConvertDoctrine1SchemaCommand extends Console\Command\Command 'The path to generate your Doctrine 2.X mapping information.' ), new InputOption( - 'from', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'from', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Optional paths of Doctrine 1.X schema information.', array() ), new InputOption( - 'extend', null, InputOption::PARAMETER_OPTIONAL, + 'extend', null, InputOption::VALUE_OPTIONAL, 'Defines a base class to be extended by generated entity classes.' ), new InputOption( - 'num-spaces', null, InputOption::PARAMETER_OPTIONAL, + 'num-spaces', null, InputOption::VALUE_OPTIONAL, 'Defines the number of indentation spaces', 4 ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php index ad3134779..75fea1f89 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php @@ -53,7 +53,7 @@ class ConvertMappingCommand extends Console\Command\Command ->setDescription('Convert mapping information between supported formats.') ->setDefinition(array( new InputOption( - 'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.' ), new InputArgument( @@ -67,11 +67,11 @@ class ConvertMappingCommand extends Console\Command\Command 'from-database', null, null, 'Whether or not to convert mapping information from existing database.' ), new InputOption( - 'extend', null, InputOption::PARAMETER_OPTIONAL, + 'extend', null, InputOption::VALUE_OPTIONAL, 'Defines a base class to be extended by generated entity classes.' ), new InputOption( - 'num-spaces', null, InputOption::PARAMETER_OPTIONAL, + 'num-spaces', null, InputOption::VALUE_OPTIONAL, 'Defines the number of indentation spaces', 4 ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php index 4fdd8fad7..d29bfce0b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php @@ -49,7 +49,7 @@ class EnsureProductionSettingsCommand extends Console\Command\Command ->setDescription('Verify that Doctrine is properly configured for a production environment.') ->setDefinition(array( new InputOption( - 'complete', null, InputOption::PARAMETER_NONE, + 'complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existance.' ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 3014d57ae..f69b5167f 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -52,34 +52,34 @@ class GenerateEntitiesCommand extends Console\Command\Command ->setDescription('Generate entity classes and method stubs from your mapping information.') ->setDefinition(array( new InputOption( - 'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.' ), new InputArgument( 'dest-path', InputArgument::REQUIRED, 'The path to generate your entity classes.' ), new InputOption( - 'generate-annotations', null, InputOption::PARAMETER_OPTIONAL, + 'generate-annotations', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate annotation metadata on entities.', false ), new InputOption( - 'generate-methods', null, InputOption::PARAMETER_OPTIONAL, + 'generate-methods', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should generate stub methods on entities.', true ), new InputOption( - 'regenerate-entities', null, InputOption::PARAMETER_OPTIONAL, + 'regenerate-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should regenerate entity if it exists.', false ), new InputOption( - 'update-entities', null, InputOption::PARAMETER_OPTIONAL, + 'update-entities', null, InputOption::VALUE_OPTIONAL, 'Flag to define if generator should only update entity if it exists.', true ), new InputOption( - 'extend', null, InputOption::PARAMETER_OPTIONAL, + 'extend', null, InputOption::VALUE_OPTIONAL, 'Defines a base class to be extended by generated entity classes.' ), new InputOption( - 'num-spaces', null, InputOption::PARAMETER_OPTIONAL, + 'num-spaces', null, InputOption::VALUE_OPTIONAL, 'Defines the number of indentation spaces', 4 ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php index 09376d867..987628956 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php @@ -50,7 +50,7 @@ class GenerateProxiesCommand extends Console\Command\Command ->setDescription('Generates proxy classes for entity classes.') ->setDefinition(array( new InputOption( - 'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.' ), new InputArgument( diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php index a70aa39d0..30d36eb44 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php @@ -51,7 +51,7 @@ class GenerateRepositoriesCommand extends Console\Command\Command ->setDescription('Generate repository classes from your mapping information.') ->setDefinition(array( new InputOption( - 'filter', null, InputOption::PARAMETER_REQUIRED | InputOption::PARAMETER_IS_ARRAY, + 'filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.' ), new InputArgument( diff --git a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php index 7619534f7..c794cb996 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php @@ -50,20 +50,20 @@ class RunDqlCommand extends Console\Command\Command ->setDefinition(array( new InputArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.'), new InputOption( - 'hydrate', null, InputOption::PARAMETER_REQUIRED, + 'hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object' ), new InputOption( - 'first-result', null, InputOption::PARAMETER_REQUIRED, + 'first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.' ), new InputOption( - 'max-result', null, InputOption::PARAMETER_REQUIRED, + 'max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.' ), new InputOption( - 'depth', null, InputOption::PARAMETER_REQUIRED, + 'depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of Entity graph.', 7 ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php index a772381b3..e18a9c56a 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php @@ -53,7 +53,7 @@ class CreateCommand extends AbstractCommand ) ->setDefinition(array( new InputOption( - 'dump-sql', null, InputOption::PARAMETER_NONE, + 'dump-sql', null, InputOption::VALUE_NONE, 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' ) )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php index f72cca1fe..82d91f4c6 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php @@ -53,15 +53,15 @@ class DropCommand extends AbstractCommand ) ->setDefinition(array( new InputOption( - 'dump-sql', null, InputOption::PARAMETER_NONE, + 'dump-sql', null, InputOption::VALUE_NONE, 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' ), new InputOption( - 'force', null, InputOption::PARAMETER_NONE, + 'force', null, InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run." ), new InputOption( - 'full-database', null, InputOption::PARAMETER_NONE, + 'full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.' ), )) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php index f553a8c4b..f1a3a73cf 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php @@ -53,15 +53,15 @@ class UpdateCommand extends AbstractCommand ) ->setDefinition(array( new InputOption( - 'complete', null, InputOption::PARAMETER_NONE, + 'complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.' ), new InputOption( - 'dump-sql', null, InputOption::PARAMETER_NONE, + 'dump-sql', null, InputOption::VALUE_NONE, 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' ), new InputOption( - 'force', null, InputOption::PARAMETER_NONE, + 'force', null, InputOption::VALUE_NONE, "Don't ask for the incremental update of the database, but force the operation to run." ), )) diff --git a/lib/vendor/Symfony/Component/Console/Application.php b/lib/vendor/Symfony/Component/Console/Application.php index 850dbee20..7db8f1a86 100644 --- a/lib/vendor/Symfony/Component/Console/Application.php +++ b/lib/vendor/Symfony/Component/Console/Application.php @@ -37,7 +37,7 @@ use Symfony\Component\Console\Helper\DialogHelper; * Usage: * * $app = new Application('myapp', '1.0 (stable)'); - * $app->addCommand(new SimpleCommand()); + * $app->add(new SimpleCommand()); * $app->run(); * * @author Fabien Potencier @@ -74,18 +74,18 @@ class Application new DialogHelper(), )); - $this->addCommand(new HelpCommand()); - $this->addCommand(new ListCommand()); + $this->add(new HelpCommand()); + $this->add(new ListCommand()); $this->definition = new InputDefinition(array( new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::PARAMETER_NONE, 'Display this help message.'), - new InputOption('--quiet', '-q', InputOption::PARAMETER_NONE, 'Do not output any message.'), - new InputOption('--verbose', '-v', InputOption::PARAMETER_NONE, 'Increase verbosity of messages.'), - new InputOption('--version', '-V', InputOption::PARAMETER_NONE, 'Display this program version.'), - new InputOption('--ansi', '-a', InputOption::PARAMETER_NONE, 'Force ANSI output.'), - new InputOption('--no-interaction', '-n', InputOption::PARAMETER_NONE, 'Do not ask any interactive question.'), + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), + new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'), + new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase verbosity of messages.'), + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this program version.'), + new InputOption('--ansi', '-a', InputOption::VALUE_NONE, 'Force ANSI output.'), + new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'), )); } @@ -181,7 +181,7 @@ class Application } // the command name MUST be the first element of the input - $command = $this->findCommand($name); + $command = $this->find($name); $this->runningCommand = $command; $statusCode = $command->run($input, $output); @@ -329,7 +329,7 @@ class Application */ public function register($name) { - return $this->addCommand(new Command($name)); + return $this->add(new Command($name)); } /** @@ -340,7 +340,7 @@ class Application public function addCommands(array $commands) { foreach ($commands as $command) { - $this->addCommand($command); + $this->add($command); } } @@ -353,7 +353,7 @@ class Application * * @return Command The registered command */ - public function addCommand(Command $command) + public function add(Command $command) { $command->setApplication($this); @@ -375,7 +375,7 @@ class Application * * @throws \InvalidArgumentException When command name given does not exist */ - public function getCommand($name) + public function get($name) { if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name)); @@ -386,7 +386,7 @@ class Application if ($this->wantHelps) { $this->wantHelps = false; - $helpCommand = $this->getCommand('help'); + $helpCommand = $this->get('help'); $helpCommand->setCommand($command); return $helpCommand; @@ -402,7 +402,7 @@ class Application * * @return Boolean true if the command exists, false otherwise */ - public function hasCommand($name) + public function has($name) { return isset($this->commands[$name]) || isset($this->aliases[$name]); } @@ -451,7 +451,7 @@ class Application /** * Finds a command by name or alias. * - * Contrary to getCommand, this command tries to find the best + * Contrary to get, this command tries to find the best * match if you give it an abbreviation of a name or alias. * * @param string $name A command name or a command alias @@ -460,7 +460,7 @@ class Application * * @throws \InvalidArgumentException When command name is incorrect or ambiguous */ - public function findCommand($name) + public function find($name) { // namespace $namespace = ''; @@ -481,7 +481,7 @@ class Application $abbrevs = static::getAbbreviations($commands); if (isset($abbrevs[$name]) && 1 == count($abbrevs[$name])) { - return $this->getCommand($namespace ? $namespace.':'.$abbrevs[$name][0] : $abbrevs[$name][0]); + return $this->get($namespace ? $namespace.':'.$abbrevs[$name][0] : $abbrevs[$name][0]); } if (isset($abbrevs[$name]) && count($abbrevs[$name]) > 1) { @@ -500,7 +500,7 @@ class Application throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $fullName, $this->getAbbreviationSuggestions($abbrevs[$fullName]))); } - return $this->getCommand($abbrevs[$fullName][0]); + return $this->get($abbrevs[$fullName][0]); } /** @@ -512,7 +512,7 @@ class Application * * @return array An array of Command instances */ - public function getCommands($namespace = null) + public function all($namespace = null) { if (null === $namespace) { return $this->commands; @@ -566,7 +566,7 @@ class Application */ public function asText($namespace = null) { - $commands = $namespace ? $this->getCommands($this->findNamespace($namespace)) : $this->commands; + $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; $messages = array($this->getHelp(), ''); if ($namespace) { @@ -607,7 +607,7 @@ class Application */ public function asXml($namespace = null, $asDom = false) { - $commands = $namespace ? $this->getCommands($this->findNamespace($namespace)) : $this->commands; + $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands; $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->formatOutput = true; diff --git a/lib/vendor/Symfony/Component/Console/Command/Command.php b/lib/vendor/Symfony/Component/Console/Command/Command.php index 5f04baa54..3777d9617 100644 --- a/lib/vendor/Symfony/Component/Console/Command/Command.php +++ b/lib/vendor/Symfony/Component/Console/Command/Command.php @@ -236,9 +236,9 @@ class Command * * @param string $name The option name * @param string $shortcut The shortcut (can be null) - * @param integer $mode The option mode: self::PARAMETER_REQUIRED, self::PARAMETER_NONE or self::PARAMETER_OPTIONAL + * @param integer $mode The option mode: One of the InputOption::VALUE_* constants * @param string $description A description text - * @param mixed $default The default value (must be null for self::PARAMETER_REQUIRED or self::PARAMETER_NONE) + * @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or self::VALUE_NONE) * * @return Command The current instance */ diff --git a/lib/vendor/Symfony/Component/Console/Command/HelpCommand.php b/lib/vendor/Symfony/Component/Console/Command/HelpCommand.php index 5e0c30739..5504832d8 100644 --- a/lib/vendor/Symfony/Component/Console/Command/HelpCommand.php +++ b/lib/vendor/Symfony/Component/Console/Command/HelpCommand.php @@ -37,7 +37,7 @@ class HelpCommand extends Command $this ->setDefinition(array( new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('xml', null, InputOption::PARAMETER_NONE, 'To output help as XML'), + new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), )) ->setName('help') ->setAliases(array('?')) @@ -65,7 +65,7 @@ EOF protected function execute(InputInterface $input, OutputInterface $output) { if (null === $this->command) { - $this->command = $this->application->getCommand($input->getArgument('command_name')); + $this->command = $this->application->get($input->getArgument('command_name')); } if ($input->getOption('xml')) { diff --git a/lib/vendor/Symfony/Component/Console/Command/ListCommand.php b/lib/vendor/Symfony/Component/Console/Command/ListCommand.php index f180e4124..a1f77e97c 100644 --- a/lib/vendor/Symfony/Component/Console/Command/ListCommand.php +++ b/lib/vendor/Symfony/Component/Console/Command/ListCommand.php @@ -33,7 +33,7 @@ class ListCommand extends Command $this ->setDefinition(array( new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('xml', null, InputOption::PARAMETER_NONE, 'To output help as XML'), + new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), )) ->setName('list') ->setDescription('Lists commands') diff --git a/lib/vendor/Symfony/Component/Console/Input/ArgvInput.php b/lib/vendor/Symfony/Component/Console/Input/ArgvInput.php index beb6fc436..a1ca7a26a 100644 --- a/lib/vendor/Symfony/Component/Console/Input/ArgvInput.php +++ b/lib/vendor/Symfony/Component/Console/Input/ArgvInput.php @@ -88,7 +88,7 @@ class ArgvInput extends Input $name = substr($token, 1); if (strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptParameter()) { + if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { // an option with a value (with no space) $this->addShortOption($name[0], substr($name, 1)); } else { @@ -115,7 +115,7 @@ class ArgvInput extends Input } $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptParameter()) { + if ($option->acceptValue()) { $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); break; @@ -190,7 +190,7 @@ class ArgvInput extends Input $option = $this->definition->getOption($name); - if (null === $value && $option->acceptParameter()) { + if (null === $value && $option->acceptValue()) { // if option accepts an optional or mandatory argument // let's see if there is one provided $next = array_shift($this->parsed); @@ -202,11 +202,11 @@ class ArgvInput extends Input } if (null === $value) { - if ($option->isParameterRequired()) { + if ($option->isValueRequired()) { throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); } - $value = $option->isParameterOptional() ? $option->getDefault() : true; + $value = $option->isValueOptional() ? $option->getDefault() : true; } $this->options[$name] = $value; diff --git a/lib/vendor/Symfony/Component/Console/Input/ArrayInput.php b/lib/vendor/Symfony/Component/Console/Input/ArrayInput.php index 786d3ad71..865e48205 100644 --- a/lib/vendor/Symfony/Component/Console/Input/ArrayInput.php +++ b/lib/vendor/Symfony/Component/Console/Input/ArrayInput.php @@ -133,11 +133,11 @@ class ArrayInput extends Input $option = $this->definition->getOption($name); if (null === $value) { - if ($option->isParameterRequired()) { + if ($option->isValueRequired()) { throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name)); } - $value = $option->isParameterOptional() ? $option->getDefault() : true; + $value = $option->isValueOptional() ? $option->getDefault() : true; } $this->options[$name] = $value; diff --git a/lib/vendor/Symfony/Component/Console/Input/InputDefinition.php b/lib/vendor/Symfony/Component/Console/Input/InputDefinition.php index cc737440d..bc2e8bcc7 100644 --- a/lib/vendor/Symfony/Component/Console/Input/InputDefinition.php +++ b/lib/vendor/Symfony/Component/Console/Input/InputDefinition.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Console\Input; * * $definition = new InputDefinition(array( * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::PARAMETER_REQUIRED), + * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), * )); * * @author Fabien Potencier @@ -347,7 +347,7 @@ class InputDefinition $elements = array(); foreach ($this->getOptions() as $option) { $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $elements[] = sprintf('['.($option->isParameterRequired() ? '%s--%s="..."' : ($option->isParameterOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); + $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); } foreach ($this->getArguments() as $argument) { @@ -399,7 +399,7 @@ class InputDefinition $text[] = 'Options:'; foreach ($this->getOptions() as $option) { - if ($option->acceptParameter() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) { + if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) { $default = sprintf(' (default: %s)', is_array($option->getDefault()) ? str_replace("\n", '', print_r($option->getDefault(), true)): $option->getDefault()); } else { $default = ''; @@ -450,13 +450,13 @@ class InputDefinition $optionsXML->appendChild($optionXML = $dom->createElement('option')); $optionXML->setAttribute('name', '--'.$option->getName()); $optionXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - $optionXML->setAttribute('accept_parameter', $option->acceptParameter() ? 1 : 0); - $optionXML->setAttribute('is_parameter_required', $option->isParameterRequired() ? 1 : 0); + $optionXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); + $optionXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); $optionXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); $optionXML->appendChild($descriptionXML = $dom->createElement('description')); $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - if ($option->acceptParameter()) { + if ($option->acceptValue()) { $optionXML->appendChild($defaultsXML = $dom->createElement('defaults')); $defaults = is_array($option->getDefault()) ? $option->getDefault() : ($option->getDefault() ? array($option->getDefault()) : array()); foreach ($defaults as $default) { diff --git a/lib/vendor/Symfony/Component/Console/Input/InputOption.php b/lib/vendor/Symfony/Component/Console/Input/InputOption.php index ca76c826f..3b22bbe1e 100644 --- a/lib/vendor/Symfony/Component/Console/Input/InputOption.php +++ b/lib/vendor/Symfony/Component/Console/Input/InputOption.php @@ -18,10 +18,10 @@ namespace Symfony\Component\Console\Input; */ class InputOption { - const PARAMETER_NONE = 1; - const PARAMETER_REQUIRED = 2; - const PARAMETER_OPTIONAL = 4; - const PARAMETER_IS_ARRAY = 8; + const VALUE_NONE = 1; + const VALUE_REQUIRED = 2; + const VALUE_OPTIONAL = 4; + const VALUE_IS_ARRAY = 8; protected $name; protected $shortcut; @@ -34,9 +34,9 @@ class InputOption * * @param string $name The option name * @param string $shortcut The shortcut (can be null) - * @param integer $mode The option mode: self::PARAMETER_REQUIRED, self::PARAMETER_NONE or self::PARAMETER_OPTIONAL + * @param integer $mode The option mode: One of the VALUE_* constants * @param string $description A description text - * @param mixed $default The default value (must be null for self::PARAMETER_REQUIRED or self::PARAMETER_NONE) + * @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE) * * @throws \InvalidArgumentException If option mode is invalid or incompatible */ @@ -57,7 +57,7 @@ class InputOption } if (null === $mode) { - $mode = self::PARAMETER_NONE; + $mode = self::VALUE_NONE; } else if (!is_int($mode) || $mode > 15) { throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); } @@ -67,8 +67,8 @@ class InputOption $this->mode = $mode; $this->description = $description; - if ($this->isArray() && !$this->acceptParameter()) { - throw new \InvalidArgumentException('Impossible to have an option mode PARAMETER_IS_ARRAY if the option does not accept a parameter.'); + if ($this->isArray() && !$this->acceptValue()) { + throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); } $this->setDefault($default); @@ -95,43 +95,43 @@ class InputOption } /** - * Returns true if the option accept a parameter. + * Returns true if the option accepts a value. * - * @return Boolean true if parameter mode is not self::PARAMETER_NONE, false otherwise + * @return Boolean true if value mode is not self::VALUE_NONE, false otherwise */ - public function acceptParameter() + public function acceptValue() { - return $this->isParameterRequired() || $this->isParameterOptional(); + return $this->isValueRequired() || $this->isValueOptional(); } /** - * Returns true if the option requires a parameter. + * Returns true if the option requires a value. * - * @return Boolean true if parameter mode is self::PARAMETER_REQUIRED, false otherwise + * @return Boolean true if value mode is self::VALUE_REQUIRED, false otherwise */ - public function isParameterRequired() + public function isValueRequired() { - return self::PARAMETER_REQUIRED === (self::PARAMETER_REQUIRED & $this->mode); + return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); } /** - * Returns true if the option takes an optional parameter. + * Returns true if the option takes an optional value. * - * @return Boolean true if parameter mode is self::PARAMETER_OPTIONAL, false otherwise + * @return Boolean true if value mode is self::VALUE_OPTIONAL, false otherwise */ - public function isParameterOptional() + public function isValueOptional() { - return self::PARAMETER_OPTIONAL === (self::PARAMETER_OPTIONAL & $this->mode); + return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); } /** * Returns true if the option can take multiple values. * - * @return Boolean true if mode is self::PARAMETER_IS_ARRAY, false otherwise + * @return Boolean true if mode is self::VALUE_IS_ARRAY, false otherwise */ public function isArray() { - return self::PARAMETER_IS_ARRAY === (self::PARAMETER_IS_ARRAY & $this->mode); + return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); } /** @@ -141,8 +141,8 @@ class InputOption */ public function setDefault($default = null) { - if (self::PARAMETER_NONE === (self::PARAMETER_NONE & $this->mode) && null !== $default) { - throw new \LogicException('Cannot set a default value when using Option::PARAMETER_NONE mode.'); + if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { + throw new \LogicException('Cannot set a default value when using Option::VALUE_NONE mode.'); } if ($this->isArray()) { @@ -153,7 +153,7 @@ class InputOption } } - $this->default = $this->acceptParameter() ? $default : false; + $this->default = $this->acceptValue() ? $default : false; } /** diff --git a/lib/vendor/Symfony/Component/Console/Shell.php b/lib/vendor/Symfony/Component/Console/Shell.php index 278572795..38b2fbbfe 100644 --- a/lib/vendor/Symfony/Component/Console/Shell.php +++ b/lib/vendor/Symfony/Component/Console/Shell.php @@ -97,7 +97,7 @@ class Shell // task name? if (false === strpos($text, ' ') || !$text) { - return array_keys($this->application->getCommands()); + return array_keys($this->application->all()); } // options and arguments?