diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 06504a0810..69fb9dad9b 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -979,6 +979,22 @@ UPGRADE FROM 2.x to 3.0 $plural = $violation->getPlural(); ``` + * The class `Symfony\Component\Validator\DefaultTranslator` was removed. You + should use `Symfony\Component\Translation\IdentityTranslator` instead. + + Before: + + ```php + $translator = new \Symfony\Component\Validator\DefaultTranslator(); + ``` + + After: + + ```php + $translator = new \Symfony\Component\Translation\IdentityTranslator(); + $translator->setLocale('en'); + ``` + ### Yaml * The ability to pass file names to `Yaml::parse()` has been removed. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index 92a84affd6..5b627ded6a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -40,21 +40,21 @@ class AssetsInstallCommand extends ContainerAwareCommand ->setDescription('Installs bundles web assets under a public web directory') ->setHelp(<<%command.name% command installs bundle assets into a given -directory (e.g. the web directory). +directory (e.g. the web directory). -php %command.full_name% web + php %command.full_name% web -A "bundles" directory will be created inside the target directory, and the +A "bundles" directory will be created inside the target directory and the "Resources/public" directory of each bundle will be copied into it. To create a symlink to each bundle instead of copying its assets, use the --symlink option (will fall back to hard copies when symbolic links aren't possible: -php %command.full_name% web --symlink + php %command.full_name% web --symlink To make symlink relative, add the --relative option: -php %command.full_name% web --symlink --relative + php %command.full_name% web --symlink --relative EOT ) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index f7025126ac..6e85702cf6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -41,9 +41,8 @@ class CacheClearCommand extends ContainerAwareCommand The %command.name% command clears the application cache for a given environment and debug mode: -php %command.full_name% --env=dev -php %command.full_name% --env=prod --no-debug - + php %command.full_name% --env=dev + php %command.full_name% --env=prod --no-debug EOF ) ; diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php index 4b9043692b..dd52dd10ee 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php @@ -35,11 +35,10 @@ class ConfigDebugCommand extends AbstractConfigCommand 'config:debug', )) ->setDefinition(array( - new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'), + new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'), )) ->setDescription('Dumps the current configuration for an extension') ->setHelp(<<%command.name% command dumps the current configuration for an extension/bundle. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php index 4a92fd63a8..98dc9109cc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php @@ -48,7 +48,7 @@ Either the extension alias or bundle name can be used: php %command.full_name% framework php %command.full_name% FrameworkBundle -With the format option specifies the format of the configuration, +With the --format option specifies the format of the configuration, this is either yaml or xml. When the option is not provided, yaml is used. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index c26fa01c37..2c3d56f676 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -64,7 +64,7 @@ To get specific information about a service, specify its name: php %command.full_name% validator By default, private services are hidden. You can display all services by -using the --show-private flag: +using the --show-private flag: php %command.full_name% --show-private @@ -72,15 +72,15 @@ Use the --tags option to display tagged public services group php %command.full_name% --tags -Find all services with a specific tag by specifying the tag name with the --tag option: +Find all services with a specific tag by specifying the tag name with the --tag option: php %command.full_name% --tag=form.type -Use the --parameters option to display all parameters: +Use the --parameters option to display all parameters: php %command.full_name% --parameters -Display a specific parameter by specifying his name with the --parameter option: +Display a specific parameter by specifying his name with the --parameter option: php %command.full_name% --parameter=kernel.debug diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index f50817004c..8901522e1c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -64,7 +64,7 @@ class RouterDebugCommand extends ContainerAwareCommand The %command.name% displays the configured routes: php %command.full_name% - + EOF ) ; diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php index 38536e0f69..c1afc9d83b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php @@ -60,7 +60,9 @@ class RouterMatchCommand extends ContainerAwareCommand The %command.name% shows which routes match a given request and which don't and for what reason: php %command.full_name% /foo - or + +or + php %command.full_name% /foo --method POST --scheme https --host symfony.com --verbose EOF diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php index f5fe6b6921..977de6ef88 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php @@ -41,23 +41,23 @@ class ServerStartCommand extends ServerCommand ->setHelp(<<%command.name% runs PHP's built-in web server: - %command.full_name% + php %command.full_name% To change the default bind address and the default port use the address argument: - %command.full_name% 127.0.0.1:8080 + php %command.full_name% 127.0.0.1:8080 To change the default document root directory use the --docroot option: - %command.full_name% --docroot=htdocs/ + php %command.full_name% --docroot=htdocs/ If you have a custom document root directory layout, you can specify your own router script using the --router option: - %command.full_name% --router=app/config/router.php + php %command.full_name% --router=app/config/router.php -Specifying a router script is required when the used environment is not "dev" or -"prod". +Specifying a router script is required when the used environment is not "dev" or +"prod". See also: http://www.php.net/manual/en/features.commandline.webserver.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php index cba9f7a8c4..9b0656c220 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php @@ -36,11 +36,11 @@ class ServerStopCommand extends ServerCommand ->setHelp(<<%command.name% stops PHP's built-in web server: - %command.full_name% + php %command.full_name% To change the default bind address and the default port use the address argument: - %command.full_name% 127.0.0.1:8080 + php %command.full_name% 127.0.0.1:8080 EOF ) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index 703e55ebb0..e03e3ac1c0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -57,19 +57,19 @@ templates and translation files of a given bundle. You can display information about bundle translations in a specific locale: -php %command.full_name% en AcmeDemoBundle + php %command.full_name% en AcmeDemoBundle You can also specify a translation domain for the search: -php %command.full_name% --domain=messages en AcmeDemoBundle + php %command.full_name% --domain=messages en AcmeDemoBundle You can only display missing messages: -php %command.full_name% --only-missing en AcmeDemoBundle + php %command.full_name% --only-missing en AcmeDemoBundle You can only display unused messages: -php %command.full_name% --only-unused en AcmeDemoBundle + php %command.full_name% --only-unused en AcmeDemoBundle EOF ) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index dadb7d158b..f30e9fd833 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -36,30 +36,12 @@ class TranslationUpdateCommand extends ContainerAwareCommand ->setDefinition(array( new InputArgument('locale', InputArgument::REQUIRED, 'The locale'), new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle where to load the messages, defaults to app/Resources folder', null), - new InputOption( - 'prefix', null, InputOption::VALUE_OPTIONAL, - 'Override the default prefix', '__' - ), - new InputOption( - 'output-format', null, InputOption::VALUE_OPTIONAL, - 'Override the default output format', 'yml' - ), - new InputOption( - 'dump-messages', null, InputOption::VALUE_NONE, - 'Should the messages be dumped in the console' - ), - new InputOption( - 'force', null, InputOption::VALUE_NONE, - 'Should the update be done' - ), - new InputOption( - 'no-backup', null, InputOption::VALUE_NONE, - 'Should backup be disabled' - ), - new InputOption( - 'clean', null, InputOption::VALUE_NONE, - 'Should clean not found messages' - ), + new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'), + new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'yml'), + new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'), + new InputOption('force', null, InputOption::VALUE_NONE, 'Should the update be done'), + new InputOption('no-backup', null, InputOption::VALUE_NONE, 'Should backup be disabled'), + new InputOption('clean', null, InputOption::VALUE_NONE, 'Should clean not found messages'), )) ->setDescription('Updates the translation file') ->setHelp(<<php %command.full_name% --dump-messages en AcmeBundle -php %command.full_name% --force --prefix="new_" fr AcmeBundle + php %command.full_name% --dump-messages en AcmeBundle + php %command.full_name% --force --prefix="new_" fr AcmeBundle Example running against app messages (app/Resources folder) -php %command.full_name% --dump-messages en -php %command.full_name% --force --prefix="new_" fr - + php %command.full_name% --dump-messages en + php %command.full_name% --force --prefix="new_" fr EOF ) ; diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index 83d63f802f..05efa0c7b7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -39,20 +39,20 @@ the first encountered syntax error. You can validate the syntax of a file: -php %command.full_name% filename + php %command.full_name% filename Or of a whole directory: -php %command.full_name% dirname -php %command.full_name% dirname --format=json + php %command.full_name% dirname + php %command.full_name% dirname --format=json Or all YAML files in a bundle: -php %command.full_name% @AcmeDemoBundle + php %command.full_name% @AcmeDemoBundle You can also pass the YAML contents from STDIN: -cat filename | php %command.full_name% + cat filename | php %command.full_name% EOF ) diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index c3196347e5..f93dd7dce5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -24,6 +24,8 @@ use Symfony\Component\Routing\RouteCollection; /** * @author Jean-François Simon + * + * @internal */ abstract class Descriptor implements DescriptorInterface { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php index 2f2f8020dd..b0cff72e89 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Routing\RouteCollection; /** * @author Jean-François Simon + * + * @internal */ class JsonDescriptor extends Descriptor { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php index 173b5038e9..b586194da8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Routing\RouteCollection; /** * @author Jean-François Simon + * + * @internal */ class MarkdownDescriptor extends Descriptor { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 10d67738df..f1a4d8e672 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -22,6 +22,8 @@ use Symfony\Component\Routing\RouteCollection; /** * @author Jean-François Simon + * + * @internal */ class TextDescriptor extends Descriptor { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php index 489b446512..9a5fdbb16c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php @@ -22,6 +22,8 @@ use Symfony\Component\Routing\RouteCollection; /** * @author Jean-François Simon + * + * @internal */ class XmlDescriptor extends Descriptor { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Helper/DescriptorHelper.php b/src/Symfony/Bundle/FrameworkBundle/Console/Helper/DescriptorHelper.php index acb2a517ab..8d46ae1624 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Helper/DescriptorHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Helper/DescriptorHelper.php @@ -19,6 +19,8 @@ use Symfony\Component\Console\Helper\DescriptorHelper as BaseDescriptorHelper; /** * @author Jean-François Simon + * + * @internal */ class DescriptorHelper extends BaseDescriptorHelper { diff --git a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php index 74889454b2..fff5b1e929 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php @@ -34,13 +34,13 @@ class InitAclCommand extends ContainerAwareCommand ->setHelp(<<%command.name% command mounts ACL tables in the database. -php %command.full_name% + php %command.full_name% The name of the DBAL connection must be configured in your app/config/security.yml configuration file in the security.acl.connection variable. -security: - acl: - connection: default + security: + acl: + connection: default EOF ) ; diff --git a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php index de01dc6b33..01f5ddb11b 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php @@ -59,20 +59,22 @@ class SetAclCommand extends ContainerAwareCommand The %command.name% command sets ACL. The ACL system must have been initialized with the init:acl command. -To set VIEW and EDIT permissions for the user kevin on the instance of Acme\MyClass having the identifier 42: +To set VIEW and EDIT permissions for the user kevin on the instance of +Acme\MyClass having the identifier 42: -php %command.full_name% --user=Symfony/Component/Security/Core/User/User:kevin VIEW EDIT Acme/MyClass:42 + php %command.full_name% --user=Symfony/Component/Security/Core/User/User:kevin VIEW EDIT Acme/MyClass:42 Note that you can use / instead of \\ for the namespace delimiter to avoid any problem. To set permissions for a role, use the --role option: -php %command.full_name% --role=ROLE_USER VIEW Acme/MyClass:1936 + php %command.full_name% --role=ROLE_USER VIEW Acme/MyClass:1936 To set permissions at the class scope, use the --class-scope option: -php %command.full_name% --class-scope --user=Symfony/Component/Security/Core/User/User:anne OWNER Acme/MyClass:42 + php %command.full_name% --class-scope --user=Symfony/Component/Security/Core/User/User:anne OWNER Acme/MyClass:42 + EOF ) ->addArgument('arguments', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'A list of permissions and object identities (class name and ID separated by a column)') diff --git a/src/Symfony/Bundle/TwigBundle/Command/DebugCommand.php b/src/Symfony/Bundle/TwigBundle/Command/DebugCommand.php index 3fa1b02fe2..f98fc8d457 100644 --- a/src/Symfony/Bundle/TwigBundle/Command/DebugCommand.php +++ b/src/Symfony/Bundle/TwigBundle/Command/DebugCommand.php @@ -40,15 +40,15 @@ class DebugCommand extends ContainerAwareCommand The %command.name% command outputs a list of twig functions, filters, globals and tests. Output can be filtered with an optional argument. -php %command.full_name% + php %command.full_name% The command lists all functions, filters, etc. -php %command.full_name% date + php %command.full_name% date The command lists everything that contains the word date. -php %command.full_name% --format=json + php %command.full_name% --format=json The command lists everything in a machine readable json format. EOF diff --git a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php index 95c892cb04..a5759d8c71 100644 --- a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php +++ b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php @@ -56,10 +56,10 @@ class LintCommand extends BaseLintCommand implements ContainerAwareInterface ->setHelp( $this->getHelp().<<php %command.full_name% @AcmeDemoBundle + php %command.full_name% @AcmeDemoBundle + EOF ) ; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php b/src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php index b140e302b1..cf405530e2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Command/ExportCommand.php @@ -56,7 +56,7 @@ class ExportCommand extends Command ->setHelp(<<%command.name% command exports a profile to the standard output: -php %command.full_name% profile_token + php %command.full_name% profile_token EOF ) ; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php b/src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php index 70fecd45ea..4862e9c27a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Command/ImportCommand.php @@ -56,11 +56,11 @@ class ImportCommand extends Command ->setHelp(<<%command.name% command imports a profile: -php %command.full_name% profile_filepath + php %command.full_name% profile_filepath You can also pipe the profile via STDIN: -cat profile_file | php %command.full_name% + cat profile_file | php %command.full_name% EOF ) ; diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 6667a1ab6e..197f44d4d9 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -922,13 +922,13 @@ class Application return new InputDefinition(array( new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - 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|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'), - new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output.'), - new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output.'), - new InputOption('--no-interaction', '-n', InputOption::VALUE_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|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), + new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), + new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), + new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), + new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), )); } diff --git a/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php b/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php index cdf1493c40..a0a5df295f 100644 --- a/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php +++ b/src/Symfony/Component/Console/Descriptor/ApplicationDescription.php @@ -16,6 +16,8 @@ use Symfony\Component\Console\Command\Command; /** * @author Jean-François Simon + * + * @internal */ class ApplicationDescription { diff --git a/src/Symfony/Component/Console/Descriptor/Descriptor.php b/src/Symfony/Component/Console/Descriptor/Descriptor.php index 7536838f71..09048d79b9 100644 --- a/src/Symfony/Component/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Component/Console/Descriptor/Descriptor.php @@ -20,6 +20,8 @@ use Symfony\Component\Console\Output\OutputInterface; /** * @author Jean-François Simon + * + * @internal */ abstract class Descriptor implements DescriptorInterface { diff --git a/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php index 186da508d5..13785a40fe 100644 --- a/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/JsonDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * JSON descriptor. * * @author Jean-François Simon + * + * @internal */ class JsonDescriptor extends Descriptor { diff --git a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php index 3699f08753..db8f7df00a 100644 --- a/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * Markdown descriptor. * * @author Jean-François Simon + * + * @internal */ class MarkdownDescriptor extends Descriptor { diff --git a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php index 1ed60e1073..0709c8102b 100644 --- a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * Text descriptor. * * @author Jean-François Simon + * + * @internal */ class TextDescriptor extends Descriptor { diff --git a/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php index ac1e25e3af..5054686697 100644 --- a/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/XmlDescriptor.php @@ -21,6 +21,8 @@ use Symfony\Component\Console\Input\InputOption; * XML descriptor. * * @author Jean-François Simon + * + * @internal */ class XmlDescriptor extends Descriptor { diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json index b8b3c1f09e..7f8d92eefc 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.json @@ -1 +1 @@ -{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} +{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md index 5779a7095a..e3804162df 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.md @@ -70,7 +70,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -80,7 +80,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -90,7 +90,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -100,7 +100,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -110,7 +110,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -120,7 +120,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -130,7 +130,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` list diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt index 47b8f05f5f..dff9875f63 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: help Displays help for a command diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml index dbd6b6e84b..176310886f 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_1.xml @@ -36,25 +36,25 @@ To output raw command help diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json index 3231ddd532..1655d47e62 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.json +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.json @@ -1 +1 @@ -{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}},{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}},{"name":"descriptor:command2","usage":"descriptor:command2 [-o|--option_name] argument_name","description":"command 2 description","help":"command 2 help","aliases":[],"definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message.","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message.","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version.","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output.","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output.","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question.","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} +{"commands":[{"name":"help","usage":"help [--xml] [--format=\"...\"] [--raw] [command_name]","description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","aliases":[],"definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output help in other formats","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":"list [--xml] [--raw] [--format=\"...\"] [namespace]","description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","aliases":[],"definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"To output list in other formats","default":"txt"}}}},{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"descriptor:command2","usage":"descriptor:command2 [-o|--option_name] argument_name","description":"command 2 description","help":"command 2 help","aliases":[],"definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md index 3d76373cff..7492886ea3 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.md +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.md @@ -77,7 +77,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -87,7 +87,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -97,7 +97,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -107,7 +107,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -117,7 +117,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -127,7 +127,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -137,7 +137,7 @@ To display the list of available commands, please use the list comm * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` list @@ -223,7 +223,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -233,7 +233,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -243,7 +243,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -253,7 +253,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -263,7 +263,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -273,7 +273,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -283,7 +283,7 @@ command 1 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` descriptor:command2 @@ -324,7 +324,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this help message. +* Description: Display this help message * Default: `false` **quiet:** @@ -334,7 +334,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not output any message. +* Description: Do not output any message * Default: `false` **verbose:** @@ -344,7 +344,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. +* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug * Default: `false` **version:** @@ -354,7 +354,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Display this application version. +* Description: Display this application version * Default: `false` **ansi:** @@ -364,7 +364,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Force ANSI output. +* Description: Force ANSI output * Default: `false` **no-ansi:** @@ -374,7 +374,7 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Disable ANSI output. +* Description: Disable ANSI output * Default: `false` **no-interaction:** @@ -384,5 +384,5 @@ command 2 help * Accept value: no * Is value required: no * Is multiple: no -* Description: Do not ask any interactive question. +* Description: Do not ask any interactive question * Default: `false` diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt index 4dbe271902..80619a71aa 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: alias1 command 1 description diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml b/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml index daab7a99ca..a7d65b4f86 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_2.xml @@ -36,25 +36,25 @@ To output raw command help @@ -109,25 +109,25 @@ @@ -147,25 +147,25 @@ diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt index 248537df03..c87fde4c92 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: afoobar The foo:bar command diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt index 16310aa79f..130ac5252b 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt @@ -4,13 +4,13 @@ [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands for the "foo" namespace: foo:bar The foo:bar command diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt index ffff85970b..d9567819a1 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt @@ -36,25 +36,25 @@ To output raw command help @@ -108,25 +108,25 @@ diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt index 0d0ab95e98..0b30b201f2 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt @@ -11,25 +11,25 @@ diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt index e4be367c85..0df294ad26 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run1.txt @@ -4,13 +4,13 @@ Usage: [options] command [arguments] Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Available commands: help Displays help for a command diff --git a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt index e456a48466..6963c0f164 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/application_run2.txt @@ -9,13 +9,13 @@ Options: --xml To output help as XML --format To output help in other formats (default: "txt") --raw To output raw command help - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Help: The help command displays help for a given command: diff --git a/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt b/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt index 12fc4b6fb1..5d703512f7 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/command_astext.txt @@ -6,13 +6,13 @@ command The command to execute Options: - --help (-h) Display this help message. - --quiet (-q) Do not output any message. - --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. - --version (-V) Display this application version. - --ansi Force ANSI output. - --no-ansi Disable ANSI output. - --no-interaction (-n) Do not ask any interactive question. + --help (-h) Display this help message + --quiet (-q) Do not output any message + --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + --version (-V) Display this application version + --ansi Force ANSI output + --no-ansi Disable ANSI output + --no-interaction (-n) Do not ask any interactive question Help: help diff --git a/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt b/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt index 04291a48be..57542faad5 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt @@ -14,25 +14,25 @@ diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php b/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php index 69e7937d18..4d249f69ef 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php @@ -25,6 +25,8 @@ use Symfony\Component\DependencyInjection\Scope; * * @author Fabien Potencier * @author Johannes M. Schmitt + * + * @deprecated since version 2.7, to be removed in 3.0. */ class ContainerAwareHttpKernel extends HttpKernel { @@ -55,8 +57,6 @@ class ContainerAwareHttpKernel extends HttpKernel */ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) { - $request->headers->set('X-Php-Ob-Level', ob_get_level()); - $this->container->enterScope('request'); $this->container->set('request', $request, 'request'); diff --git a/src/Symfony/Component/HttpKernel/HttpKernel.php b/src/Symfony/Component/HttpKernel/HttpKernel.php index 966cf6c324..ca79f62b97 100644 --- a/src/Symfony/Component/HttpKernel/HttpKernel.php +++ b/src/Symfony/Component/HttpKernel/HttpKernel.php @@ -62,6 +62,8 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface */ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) { + $request->headers->set('X-Php-Ob-Level', ob_get_level()); + try { return $this->handleRaw($request, $type); } catch (\Exception $e) { diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index 88153faf17..dc925b75bd 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.7.0 +----- + + * deprecated `DefaultTranslator` in favor of `Symfony\Component\Translation\IdentityTranslator` + 2.6.0 ----- diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index 06967de922..e15942f80d 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +trigger_error('The class '.__NAMESPACE__.'\DefaultTranslator is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Translation\IdentityTranslator instead.', E_USER_DEPRECATED); + use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Exception\BadMethodCallException; use Symfony\Component\Validator\Exception\InvalidArgumentException; @@ -43,6 +45,8 @@ use Symfony\Component\Validator\Exception\InvalidArgumentException; * {@link \Symfony\Component\Translation\Translator} and can be used in places * where translation is not required by default but should be optional. * + * @deprecated since version 2.7, to be removed in 3.0. Use Symfony\Component\Translation\IdentityTranslator instead. + * * @author Bernhard Schussek */ class DefaultTranslator implements TranslatorInterface diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php index 4509e22ee1..56f9bd4ab8 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Validator\Tests\Validator; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Validator\ConstraintValidatorFactory; use Symfony\Component\Validator\Context\LegacyExecutionContextFactory; -use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\Validator\LegacyValidator; @@ -21,7 +21,10 @@ class LegacyValidator2Dot5ApiTest extends Abstract2Dot5ApiTest { protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { - $contextFactory = new LegacyExecutionContextFactory($metadataFactory, new DefaultTranslator()); + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator); $validatorFactory = new ConstraintValidatorFactory(); return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php index 3f7bf1e5bb..42e6e40311 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Validator\Tests\Validator; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Validator\ConstraintValidatorFactory; use Symfony\Component\Validator\Context\LegacyExecutionContextFactory; -use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\Validator\LegacyValidator; @@ -21,7 +21,10 @@ class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest { protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { - $contextFactory = new LegacyExecutionContextFactory($metadataFactory, new DefaultTranslator()); + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator); $validatorFactory = new ConstraintValidatorFactory(); return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); diff --git a/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php index 6235fda902..05961269a5 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Validator\Tests\Validator; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Validator\ConstraintValidatorFactory; use Symfony\Component\Validator\Context\ExecutionContextFactory; -use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\Validator\RecursiveValidator; @@ -21,7 +21,10 @@ class RecursiveValidator2Dot5ApiTest extends Abstract2Dot5ApiTest { protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { - $contextFactory = new ExecutionContextFactory(new DefaultTranslator()); + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new ExecutionContextFactory($translator); $validatorFactory = new ConstraintValidatorFactory(); return new RecursiveValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); diff --git a/src/Symfony/Component/Validator/Tests/ValidatorTest.php b/src/Symfony/Component/Validator/Tests/ValidatorTest.php index 3cc36f5e23..ebeeb3af0f 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Validator\Tests; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\ConstraintValidatorFactory; -use Symfony\Component\Validator\DefaultTranslator; use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\Tests\Fixtures\Entity; use Symfony\Component\Validator\Tests\Validator\AbstractLegacyApiTest; @@ -23,7 +23,10 @@ class ValidatorTest extends AbstractLegacyApiTest { protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { - return new LegacyValidator($metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator(), 'validators', $objectInitializers); + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + return new LegacyValidator($metadataFactory, new ConstraintValidatorFactory(), $translator, 'validators', $objectInitializers); } /** diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 29bd1f9dcc..5f746d59bb 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -16,6 +16,7 @@ use Doctrine\Common\Annotations\CachedReader; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Cache\ArrayCache; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Context\ExecutionContextFactory; use Symfony\Component\Validator\Context\LegacyExecutionContextFactory; @@ -387,7 +388,16 @@ class ValidatorBuilder implements ValidatorBuilderInterface } $validatorFactory = $this->validatorFactory ?: new ConstraintValidatorFactory($this->propertyAccessor); - $translator = $this->translator ?: new DefaultTranslator(); + $translator = $this->translator; + + if (null === $translator) { + $translator = new IdentityTranslator(); + // Force the locale to be 'en' when no translator is provided rather than relying on the Intl default locale + // This avoids depending on Intl or the stub implementation being available. It also ensures that Symfony + // validation messages are pluralized properly even when the default locale gets changed because they are in + // English. + $translator->setLocale('en'); + } if (Validation::API_VERSION_2_4 === $apiVersion) { return new ValidatorV24($metadataFactory, $validatorFactory, $translator, $this->translationDomain, $this->initializers);