From b7d55ede157c206e5e0c9355fcc30b5c16bdc6e2 Mon Sep 17 00:00:00 2001 From: Oleksii Zhurbytskyi Date: Mon, 23 Jul 2018 13:56:58 +0300 Subject: [PATCH 01/18] Add missing Ukrainian translations --- .../Resources/translations/validators.uk.xlf | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index 1a734710a63ba..6a92801c9b47d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -278,6 +278,42 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Значення не повинно бути ідентичним {{ compared_value_type }} {{ compared_value }}. + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Співвідношення сторін зображення занадто велике ({{ ratio }}). Максимальне співвідношення сторін {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Співвідношення сторін зображення занадто мало ({{ ratio }}). Мінімальне співвідношення сторін {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Зображення квадратне ({{ width }}x{{ height }}px). Квадратні зображення не дозволені. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Зображення альбомної орієнтації ({{ width }}x{{ height }}px). Зображення альбомної орієнтації не дозволені. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Зображення в портретній орієнтації ({{ width }}x{{ height }}px). Зображення в портретної орієнтації не дозволені. + + + An empty file is not allowed. + Порожні файли не дозволені. + + + The host could not be resolved. + Ім'я хоста не знайдено. + + + This value does not match the expected {{ charset }} charset. + Значення не збігається з очікуваним {{ charset }} кодуванням. + + + This is not a valid Business Identifier Code (BIC). + Це не дійсний банківський код (BIC). + Error Помилка From a57549d0a1d22c695413fb0385a00d9cc93d3039 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Jul 2018 16:56:24 +0200 Subject: [PATCH 02/18] bumped Symfony version to 2.8.44 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index d97d56d20109c..70735892ffe9b 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.43'; - const VERSION_ID = 20843; + const VERSION = '2.8.44-DEV'; + const VERSION_ID = 20844; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 43; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 44; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From d3d7766874309f60249f3b0f72518d3149431cd0 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Mon, 23 Jul 2018 20:55:22 +0200 Subject: [PATCH 03/18] [HttpFoundation] Fix Cookie::isCleared --- src/Symfony/Component/HttpFoundation/Cookie.php | 2 +- .../Component/HttpFoundation/Tests/CookieTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Cookie.php b/src/Symfony/Component/HttpFoundation/Cookie.php index 93bb099cd5d24..d31f087704f78 100644 --- a/src/Symfony/Component/HttpFoundation/Cookie.php +++ b/src/Symfony/Component/HttpFoundation/Cookie.php @@ -183,6 +183,6 @@ public function isHttpOnly() */ public function isCleared() { - return $this->expire < time(); + return 0 !== $this->expire && $this->expire < time(); } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php index 2d9fb09d3d4b6..e10ee18c26ca1 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php @@ -153,6 +153,18 @@ public function testCookieIsCleared() $cookie = new Cookie('foo', 'bar', time() - 20); $this->assertTrue($cookie->isCleared(), '->isCleared() returns true if the cookie has expired'); + + $cookie = new Cookie('foo', 'bar'); + + $this->assertFalse($cookie->isCleared()); + + $cookie = new Cookie('foo', 'bar', 0); + + $this->assertFalse($cookie->isCleared()); + + $cookie = new Cookie('foo', 'bar', -1); + + $this->assertFalse($cookie->isCleared()); } public function testToString() From 8892b98627c5f584ded7dbaa5d87fb691e0a95ff Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 5 Jul 2018 12:52:40 +0200 Subject: [PATCH 04/18] Update the list of excluded files for the CS fixer --- .php_cs.dist | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index 2731440d1933b..f83990d8592c2 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -32,7 +32,11 @@ return PhpCsFixer\Config::create() 'Symfony/Component/VarDumper/Tests/Fixtures', // resource templates 'Symfony/Bundle/FrameworkBundle/Resources/views/Form', + // explicit trigger_error tests + 'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/', )) + // Support for older PHPunit version + ->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php') // file content autogenerated by `var_export` ->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php') // test template @@ -40,8 +44,6 @@ return PhpCsFixer\Config::create() // explicit heredoc test ->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php') // explicit trigger_error tests - ->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt') - ->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt') ->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php') ) ; From 720ed4d3791ebdb9710351c01c786ad0dd03e611 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 24 Jul 2018 09:45:01 +0200 Subject: [PATCH 05/18] Disable the native_constant_invocation fixer until it can be scoped We don't want to run it on non-namespaced code to reduce visual clutter. --- .php_cs.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.php_cs.dist b/.php_cs.dist index f83990d8592c2..2fcc078ebb4e0 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -15,6 +15,8 @@ return PhpCsFixer\Config::create() // rule disabled due to https://bugs.php.net/bug.php?id=60573 bug; // to be re-enabled (by dropping next line, rule is part of @Symfony already) on branch that requires PHP 5.4+ 'self_accessor' => false, + // TODO remove the disabling once https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3876 is merged and released + 'native_constant_invocation' => false, )) ->setRiskyAllowed(true) ->setFinder( From f00b3279ea874dcbd9132cabb2f5d4900c3716ea Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 24 Jul 2018 09:48:17 +0200 Subject: [PATCH 06/18] Apply fixers --- .../Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index bbd7ddfeb284e..1ea0e127f76b4 100644 --- a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -35,22 +35,22 @@ } if (in_array(STDOUT, $w) && strlen($out) > 0) { - $written = fwrite(STDOUT, (binary) $out, 32768); + $written = fwrite(STDOUT, (string) $out, 32768); if (false === $written) { die(ERR_WRITE_FAILED); } - $out = (binary) substr($out, $written); + $out = (string) substr($out, $written); } if (null === $read && '' === $out) { $write = array_diff($write, array(STDOUT)); } if (in_array(STDERR, $w) && strlen($err) > 0) { - $written = fwrite(STDERR, (binary) $err, 32768); + $written = fwrite(STDERR, (string) $err, 32768); if (false === $written) { die(ERR_WRITE_FAILED); } - $err = (binary) substr($err, $written); + $err = (string) substr($err, $written); } if (null === $read && '' === $err) { $write = array_diff($write, array(STDERR)); From 04654cfeb33ff000ec446b2b03fc179b707168e7 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 5 Jul 2018 13:24:53 +0200 Subject: [PATCH 07/18] Enable the fixer enforcing fully-qualified calls for compiler-optimized functions --- .php_cs.dist | 2 + .../Doctrine/ContainerAwareEventManager.php | 6 +- .../DataCollector/DoctrineDataCollector.php | 12 ++-- .../AbstractDoctrineExtension.php | 14 ++-- .../CompilerPass/DoctrineValidationPass.php | 2 +- ...gisterEventListenersAndSubscribersPass.php | 2 +- .../CompilerPass/RegisterMappingsPass.php | 4 +- .../Form/ChoiceList/DoctrineChoiceLoader.php | 4 +- .../Form/ChoiceList/EntityChoiceList.php | 6 +- .../Doctrine/Form/ChoiceList/IdReader.php | 6 +- .../Form/ChoiceList/ORMQueryBuilderLoader.php | 4 +- .../CollectionToArrayTransformer.php | 2 +- .../Doctrine/Form/DoctrineOrmTypeGuesser.php | 4 +- .../MergeDoctrineCollectionListener.php | 2 +- .../Doctrine/Form/Type/DoctrineType.php | 4 +- .../Bridge/Doctrine/Form/Type/EntityType.php | 4 +- .../Bridge/Doctrine/Logger/DbalLogger.php | 4 +- .../Security/User/EntityUserProvider.php | 4 +- .../Doctrine/Test/DoctrineTestHelper.php | 2 +- .../DoctrineExtensionTest.php | 4 +- .../Form/Type/EntityTypePerformanceTest.php | 2 +- .../Doctrine/Tests/Logger/DbalLoggerTest.php | 2 +- .../PropertyInfo/Fixtures/DoctrineFooType.php | 4 +- .../Security/User/EntityUserProviderTest.php | 2 +- .../Constraints/UniqueEntityValidator.php | 14 ++-- .../Validator/DoctrineInitializer.php | 2 +- .../Bridge/Monolog/Handler/DebugHandler.php | 2 +- src/Symfony/Bridge/PhpUnit/ClockMock.php | 4 +- .../PhpUnit/DeprecationErrorHandler.php | 20 +++--- src/Symfony/Bridge/PhpUnit/TextUI/Command.php | 2 +- .../Instantiator/RuntimeInstantiator.php | 2 +- .../LazyProxy/PhpDumper/ProxyDumper.php | 2 +- src/Symfony/Bridge/Twig/AppVariable.php | 2 +- .../Bridge/Twig/Command/DebugCommand.php | 12 ++-- .../Bridge/Twig/Command/LintCommand.php | 10 +-- .../Bridge/Twig/Extension/AssetExtension.php | 4 +- .../Bridge/Twig/Extension/CodeExtension.php | 10 +-- .../Bridge/Twig/Extension/DumpExtension.php | 4 +- .../Bridge/Twig/Extension/FormExtension.php | 4 +- .../Extension/HttpFoundationExtension.php | 2 +- .../Twig/Extension/RoutingExtension.php | 2 +- .../Bridge/Twig/Extension/YamlExtension.php | 10 +-- .../Bridge/Twig/Form/TwigRendererEngine.php | 4 +- .../TranslationDefaultDomainNodeVisitor.php | 4 +- .../Tests/Extension/DumpExtensionTest.php | 2 +- .../Extension/StopwatchExtensionTest.php | 2 +- .../Extension/TranslationExtensionTest.php | 2 +- .../Tests/Translation/TwigExtractorTest.php | 2 +- src/Symfony/Bundle/FrameworkBundle/Client.php | 2 +- .../Command/AbstractConfigCommand.php | 2 +- .../Command/AssetsInstallCommand.php | 2 +- .../Command/CacheClearCommand.php | 12 ++-- .../FrameworkBundle/Command/ServerCommand.php | 2 +- .../Command/ServerStartCommand.php | 2 +- .../Command/TranslationDebugCommand.php | 6 +- .../Command/TranslationUpdateCommand.php | 6 +- .../Command/YamlLintCommand.php | 6 +- .../Console/Descriptor/Descriptor.php | 12 ++-- .../Console/Descriptor/JsonDescriptor.php | 20 +++--- .../Console/Descriptor/MarkdownDescriptor.php | 26 ++++---- .../Console/Descriptor/TextDescriptor.php | 30 ++++----- .../Console/Descriptor/XmlDescriptor.php | 16 ++--- .../FrameworkBundle/Controller/Controller.php | 2 +- .../Controller/ControllerNameParser.php | 6 +- .../Controller/RedirectController.php | 2 +- .../DataCollector/RouterDataCollector.php | 2 +- .../Compiler/AddCacheWarmerPass.php | 2 +- .../Compiler/ConfigCachePass.php | 2 +- .../Compiler/PropertyInfoPass.php | 2 +- .../Compiler/SerializerPass.php | 2 +- .../Compiler/TemplatingAssetHelperPass.php | 2 +- .../Compiler/TemplatingPass.php | 2 +- .../Compiler/UnusedTagsPass.php | 4 +- .../DependencyInjection/Configuration.php | 38 +++++------ .../FrameworkExtension.php | 22 +++---- .../Routing/DelegatingLoader.php | 2 +- .../Bundle/FrameworkBundle/Routing/Router.php | 8 +-- .../Templating/DelegatingEngine.php | 2 +- .../Templating/GlobalVariables.php | 2 +- .../Templating/Helper/AssetsHelper.php | 4 +- .../Templating/Helper/CodeHelper.php | 8 +-- .../Templating/Helper/StopwatchHelper.php | 2 +- .../FrameworkBundle/Templating/PhpEngine.php | 2 +- .../Templating/TemplateFilenameParser.php | 2 +- .../FrameworkBundle/Test/KernelTestCase.php | 8 +-- .../CacheClearCommandTest.php | 2 +- .../Controller/ControllerResolverTest.php | 2 +- .../FrameworkExtensionTest.php | 10 +-- .../Controller/AnnotatedController.php | 2 +- .../Tests/Functional/WebTestCase.php | 2 +- .../Tests/Functional/app/AppKernel.php | 2 +- .../Helper/FormHelperDivLayoutTest.php | 4 +- .../Helper/FormHelperTableLayoutTest.php | 4 +- .../Templating/TemplateNameParserTest.php | 2 +- .../ConstraintValidatorFactoryTest.php | 2 +- .../Translation/PhpExtractor.php | 2 +- .../Translation/PhpStringTokenParser.php | 4 +- .../Translation/TranslationLoader.php | 2 +- .../Validator/ConstraintValidatorFactory.php | 4 +- .../SecurityBundle/Command/SetAclCommand.php | 4 +- .../Command/UserPasswordEncoderCommand.php | 4 +- .../DataCollector/SecurityDataCollector.php | 4 +- .../Compiler/AddSecurityVotersPass.php | 2 +- .../DependencyInjection/MainConfiguration.php | 8 +-- .../Security/Factory/AbstractFactory.php | 2 +- .../Factory/GuardAuthenticationFactory.php | 2 +- .../Security/Factory/RememberMeFactory.php | 4 +- .../DependencyInjection/SecurityExtension.php | 8 +-- .../CompleteConfigurationTest.php | 2 +- .../Tests/Functional/WebTestCase.php | 2 +- .../Tests/Functional/app/AppKernel.php | 2 +- .../Compiler/ExceptionListenerPass.php | 2 +- .../Compiler/ExtensionPass.php | 2 +- .../DependencyInjection/Configuration.php | 12 ++-- .../DependencyInjection/TwigExtension.php | 2 +- .../DependencyInjection/TwigExtensionTest.php | 4 +- .../EventListener/WebDebugToolbarListener.php | 2 +- src/Symfony/Component/Asset/UrlPackage.php | 6 +- src/Symfony/Component/BrowserKit/Client.php | 2 +- src/Symfony/Component/BrowserKit/Cookie.php | 4 +- .../Component/BrowserKit/CookieJar.php | 6 +- src/Symfony/Component/BrowserKit/History.php | 8 +-- src/Symfony/Component/BrowserKit/Response.php | 6 +- .../Component/ClassLoader/ApcClassLoader.php | 4 +- .../ClassLoader/ApcUniversalClassLoader.php | 2 +- .../ClassLoader/ClassCollectionLoader.php | 18 +++--- .../Component/ClassLoader/ClassLoader.php | 4 +- .../ClassLoader/ClassMapGenerator.php | 12 ++-- .../ClassLoader/DebugClassLoader.php | 6 +- .../ClassLoader/DebugUniversalClassLoader.php | 6 +- .../Component/ClassLoader/Psr4ClassLoader.php | 2 +- .../Tests/ClassCollectionLoaderTest.php | 2 +- .../ClassLoader/WinCacheClassLoader.php | 4 +- .../ClassLoader/XcacheClassLoader.php | 4 +- .../Component/Config/ConfigCacheFactory.php | 6 +- .../Component/Config/Definition/ArrayNode.php | 12 ++-- .../Config/Definition/BooleanNode.php | 4 +- .../Builder/ArrayNodeDefinition.php | 4 +- .../Config/Definition/Builder/ExprBuilder.php | 8 +-- .../Definition/Dumper/XmlReferenceDumper.php | 24 +++---- .../Definition/Dumper/YamlReferenceDumper.php | 26 ++++---- .../Component/Config/Definition/EnumNode.php | 2 +- .../Component/Config/Definition/FloatNode.php | 6 +- .../Config/Definition/IntegerNode.php | 4 +- .../Component/Config/Definition/Processor.php | 2 +- .../Config/Definition/PrototypedArrayNode.php | 16 ++--- .../Config/Definition/ScalarNode.php | 2 +- .../Exception/FileLoaderLoadException.php | 8 +-- src/Symfony/Component/Config/FileLocator.php | 2 +- .../Component/Config/Loader/FileLoader.php | 6 +- .../Resource/BCResourceInterfaceChecker.php | 2 +- .../ResourceCheckerConfigCacheFactory.php | 6 +- .../Config/Tests/Definition/ArrayNodeTest.php | 4 +- .../Builder/ArrayNodeDefinitionTest.php | 2 +- .../Definition/Builder/NodeBuilderTest.php | 4 +- .../Config/Tests/Loader/LoaderTest.php | 2 +- .../Component/Config/Util/XmlUtils.php | 16 ++--- src/Symfony/Component/Console/Application.php | 50 +++++++-------- .../Component/Console/Command/Command.php | 12 ++-- .../Console/Descriptor/Descriptor.php | 2 +- .../Console/Descriptor/MarkdownDescriptor.php | 4 +- .../Console/Descriptor/TextDescriptor.php | 16 ++--- .../Console/Descriptor/XmlDescriptor.php | 4 +- .../Console/Formatter/OutputFormatter.php | 8 +-- .../Formatter/OutputFormatterStyle.php | 8 +-- .../Formatter/OutputFormatterStyleStack.php | 4 +- .../Console/Helper/DebugFormatterHelper.php | 2 +- .../Component/Console/Helper/DialogHelper.php | 16 ++--- .../Console/Helper/FormatterHelper.php | 2 +- .../Component/Console/Helper/Helper.php | 6 +- .../Component/Console/Helper/HelperSet.php | 2 +- .../Console/Helper/ProcessHelper.php | 4 +- .../Component/Console/Helper/ProgressBar.php | 2 +- .../Console/Helper/ProgressHelper.php | 2 +- .../Console/Helper/ProgressIndicator.php | 6 +- .../Console/Helper/QuestionHelper.php | 16 ++--- .../Console/Helper/SymfonyQuestionHelper.php | 2 +- .../Component/Console/Helper/Table.php | 18 +++--- .../Component/Console/Helper/TableCell.php | 2 +- .../Component/Console/Helper/TableStyle.php | 2 +- .../Component/Console/Input/ArgvInput.php | 16 ++--- .../Component/Console/Input/ArrayInput.php | 14 ++-- src/Symfony/Component/Console/Input/Input.php | 2 +- .../Component/Console/Input/InputArgument.php | 4 +- .../Console/Input/InputDefinition.php | 8 +-- .../Component/Console/Input/InputOption.php | 6 +- .../Component/Console/Input/StringInput.php | 8 +-- .../Console/Logger/ConsoleLogger.php | 2 +- .../Console/Output/ConsoleOutput.php | 2 +- .../Component/Console/Output/StreamOutput.php | 8 +-- .../Console/Question/ChoiceQuestion.php | 2 +- .../Console/Question/ConfirmationQuestion.php | 2 +- .../Component/Console/Question/Question.php | 6 +- src/Symfony/Component/Console/Shell.php | 2 +- .../Component/Console/Style/SymfonyStyle.php | 10 +-- .../Console/Tests/Command/CommandTest.php | 2 +- .../Tests/Helper/LegacyDialogHelperTest.php | 2 +- .../Tests/Helper/LegacyProgressHelperTest.php | 2 +- .../Tests/Helper/QuestionHelperTest.php | 2 +- .../CssSelector/Node/AbstractNode.php | 2 +- .../Parser/Handler/HashHandler.php | 2 +- .../Parser/Handler/IdentifierHandler.php | 2 +- .../Parser/Handler/NumberHandler.php | 2 +- .../Parser/Handler/StringHandler.php | 8 +-- .../Parser/Handler/WhitespaceHandler.php | 2 +- .../Component/CssSelector/Parser/Parser.php | 6 +- .../Component/CssSelector/Parser/Reader.php | 2 +- .../Component/CssSelector/Parser/Token.php | 2 +- .../Parser/Tokenizer/TokenizerEscaping.php | 6 +- .../Parser/Handler/AbstractHandlerTest.php | 2 +- .../Tests/XPath/TranslatorTest.php | 8 +-- .../Extension/AttributeMatchingExtension.php | 2 +- .../CssSelector/XPath/Translator.php | 10 +-- .../Component/Debug/DebugClassLoader.php | 28 ++++---- src/Symfony/Component/Debug/ErrorHandler.php | 20 +++--- .../Debug/Exception/FatalErrorException.php | 4 +- .../Debug/Exception/FlattenException.php | 20 +++--- .../Component/Debug/ExceptionHandler.php | 16 ++--- .../ClassNotFoundFatalErrorHandler.php | 18 +++--- .../UndefinedFunctionFatalErrorHandler.php | 6 +- .../UndefinedMethodFatalErrorHandler.php | 2 +- .../Debug/Resources/ext/tests/003.phpt | 2 +- .../Debug/Tests/ErrorHandlerTest.php | 4 +- .../ClassNotFoundFatalErrorHandlerTest.php | 4 +- .../Component/Debug/Tests/HeaderMock.php | 4 +- .../Tests/phpt/decorate_exception_hander.phpt | 2 +- .../Debug/Tests/phpt/exception_rethrown.phpt | 2 +- .../phpt/fatal_with_nested_handlers.phpt | 2 +- .../Compiler/AnalyzeServiceReferencesPass.php | 6 +- .../Compiler/CheckCircularReferencesPass.php | 2 +- ...xceptionOnInvalidReferenceBehaviorPass.php | 2 +- .../Compiler/CheckReferenceValidityPass.php | 6 +- .../Compiler/InlineServiceDefinitionsPass.php | 8 +-- .../Compiler/LoggingFormatter.php | 2 +- .../Compiler/RemoveUnusedDefinitionsPass.php | 6 +- .../ReplaceAliasByActualDefinitionPass.php | 4 +- .../ResolveDefinitionTemplatesPass.php | 6 +- .../Compiler/ResolveInvalidReferencesPass.php | 2 +- .../ResolveParameterPlaceHoldersPass.php | 2 +- .../ResolveReferencesToAliasesPass.php | 4 +- .../DependencyInjection/Container.php | 10 +-- .../DependencyInjection/ContainerBuilder.php | 28 ++++---- .../DependencyInjection/Definition.php | 12 ++-- .../DefinitionDecorator.php | 4 +- .../Dumper/GraphvizDumper.php | 6 +- .../DependencyInjection/Dumper/PhpDumper.php | 64 +++++++++---------- .../DependencyInjection/Dumper/XmlDumper.php | 22 +++---- .../DependencyInjection/Dumper/YamlDumper.php | 14 ++-- .../Exception/ParameterNotFoundException.php | 2 +- .../Exception/ServiceNotFoundException.php | 2 +- .../Extension/Extension.php | 2 +- .../Instantiator/RealServiceInstantiator.php | 2 +- .../Loader/ClosureLoader.php | 2 +- .../Loader/DirectoryLoader.php | 2 +- .../Loader/IniFileLoader.php | 4 +- .../Loader/PhpFileLoader.php | 4 +- .../Loader/XmlFileLoader.php | 14 ++-- .../Loader/YamlFileLoader.php | 50 +++++++-------- .../ParameterBag/ParameterBag.php | 18 +++--- .../DependencyInjection/SimpleXMLElement.php | 2 +- .../Tests/ContainerBuilderTest.php | 4 +- .../Tests/Dumper/PhpDumperTest.php | 4 +- .../Tests/Loader/XmlFileLoaderTest.php | 4 +- src/Symfony/Component/DomCrawler/Crawler.php | 44 ++++++------- .../DomCrawler/Field/ChoiceFormField.php | 6 +- .../DomCrawler/Field/FileFormField.php | 2 +- src/Symfony/Component/DomCrawler/Form.php | 12 ++-- .../DomCrawler/FormFieldRegistry.php | 10 +-- src/Symfony/Component/DomCrawler/Link.php | 4 +- .../Component/DomCrawler/Tests/FormTest.php | 2 +- .../ContainerAwareEventDispatcher.php | 6 +- .../Debug/TraceableEventDispatcher.php | 14 ++-- .../EventDispatcher/Debug/WrappedListener.php | 2 +- .../EventDispatcher/EventDispatcher.php | 14 ++-- .../Component/ExpressionLanguage/Compiler.php | 6 +- .../ExpressionLanguage/ExpressionLanguage.php | 4 +- .../Component/ExpressionLanguage/Lexer.php | 10 +-- .../ExpressionLanguage/Node/BinaryNode.php | 6 +- .../ExpressionLanguage/Node/FunctionNode.php | 4 +- .../ExpressionLanguage/Node/GetAttrNode.php | 12 ++-- .../ExpressionLanguage/Node/Node.php | 4 +- .../Component/ExpressionLanguage/Parser.php | 4 +- .../ExpressionLanguage/Tests/LexerTest.php | 2 +- .../Component/Filesystem/Filesystem.php | 40 ++++++------ .../Filesystem/Tests/FilesystemTest.php | 6 +- .../Filesystem/Tests/FilesystemTestCase.php | 2 +- .../Filesystem/Tests/LockHandlerTest.php | 2 +- .../Finder/Adapter/AbstractFindAdapter.php | 6 +- .../Finder/Adapter/BsdFindAdapter.php | 2 +- .../Finder/Comparator/Comparator.php | 2 +- src/Symfony/Component/Finder/Finder.php | 8 +-- src/Symfony/Component/Finder/Glob.php | 2 +- .../Finder/Iterator/CustomFilterIterator.php | 4 +- .../Finder/Iterator/FilePathsIterator.php | 6 +- .../Finder/Iterator/SortableIterator.php | 2 +- .../Component/Finder/Shell/Command.php | 4 +- src/Symfony/Component/Finder/Shell/Shell.php | 4 +- .../Component/Finder/Tests/BsdFinderTest.php | 2 +- .../Component/Finder/Tests/FinderTest.php | 2 +- .../Component/Finder/Tests/GnuFinderTest.php | 2 +- .../Tests/Iterator/IteratorTestCase.php | 2 +- .../Finder/Tests/Iterator/MockSplFileInfo.php | 6 +- .../Tests/Iterator/RealIteratorTestCase.php | 8 +-- .../Tests/Iterator/SortableIteratorTest.php | 2 +- .../Component/Finder/Tests/PhpFinderTest.php | 4 +- .../Component/Form/AbstractExtension.php | 4 +- .../Component/Form/AbstractRendererEngine.php | 2 +- src/Symfony/Component/Form/AbstractType.php | 6 +- .../Component/Form/AbstractTypeExtension.php | 2 +- .../Component/Form/CallbackTransformer.php | 8 +-- .../Form/ChoiceList/ArrayChoiceList.php | 10 +-- .../Form/ChoiceList/ArrayKeyChoiceList.php | 8 +-- .../Factory/CachingFactoryDecorator.php | 8 +-- .../Factory/DefaultChoiceListFactory.php | 26 ++++---- .../Factory/PropertyAccessDecorator.php | 18 +++--- .../Form/Exception/AlreadyBoundException.php | 2 +- .../Exception/UnexpectedTypeException.php | 2 +- .../Extension/Core/ChoiceList/ChoiceList.php | 26 ++++---- .../Core/ChoiceList/LazyChoiceList.php | 2 +- .../Core/ChoiceList/ObjectChoiceList.php | 14 ++-- .../Core/ChoiceList/SimpleChoiceList.php | 4 +- .../Core/DataMapper/CheckboxListMapper.php | 6 +- .../Core/DataMapper/PropertyPathMapper.php | 6 +- .../Core/DataMapper/RadioListMapper.php | 4 +- .../ArrayToPartsTransformer.php | 8 +-- .../BaseDateTimeTransformer.php | 4 +- .../BooleanToStringTransformer.php | 4 +- .../ChoiceToBooleanArrayTransformer.php | 4 +- .../ChoiceToValueTransformer.php | 4 +- .../ChoicesToBooleanArrayTransformer.php | 6 +- .../ChoicesToValuesTransformer.php | 6 +- .../DataTransformer/DataTransformerChain.php | 2 +- .../DateTimeToArrayTransformer.php | 4 +- .../DateTimeToLocalizedStringTransformer.php | 6 +- .../DateTimeToRfc3339Transformer.php | 2 +- .../DateTimeToStringTransformer.php | 2 +- .../NumberToLocalizedStringTransformer.php | 6 +- .../PercentToLocalizedStringTransformer.php | 4 +- .../ValueToDuplicatesTransformer.php | 6 +- .../FixCheckboxInputListener.php | 4 +- .../EventListener/FixUrlProtocolListener.php | 2 +- .../EventListener/MergeCollectionListener.php | 6 +- .../Core/EventListener/ResizeFormListener.php | 6 +- .../Core/EventListener/TrimListener.php | 2 +- .../Form/Extension/Core/Type/BaseType.php | 4 +- .../Form/Extension/Core/Type/ChoiceType.php | 16 ++--- .../Extension/Core/Type/CollectionType.php | 2 +- .../Form/Extension/Core/Type/DateTimeType.php | 6 +- .../Form/Extension/Core/Type/DateType.php | 12 ++-- .../Form/Extension/Core/Type/FileType.php | 2 +- .../Form/Extension/Core/Type/FormType.php | 2 +- .../Form/Extension/Core/Type/TimeType.php | 4 +- .../Form/Extension/Core/Type/TimezoneType.php | 8 +-- .../EventListener/CsrfValidationListener.php | 2 +- .../Csrf/Type/FormTypeCsrfExtension.php | 4 +- .../DataCollector/FormDataCollector.php | 2 +- .../DataCollector/FormDataExtractor.php | 8 +-- .../DependencyInjectionExtension.php | 4 +- .../EventListener/BindRequestListener.php | 2 +- .../HttpFoundationRequestHandler.php | 6 +- .../Templating/TemplatingRendererEngine.php | 4 +- .../Validator/Constraints/FormValidator.php | 18 +++--- .../Validator/Type/BaseValidatorExtension.php | 2 +- .../Type/FormTypeValidatorExtension.php | 2 +- .../Type/UploadValidatorExtension.php | 2 +- .../Validator/ValidatorTypeGuesser.php | 16 ++--- .../Validator/ViolationMapper/MappingRule.php | 2 +- .../ViolationMapper/ViolationMapper.php | 2 +- .../ViolationMapper/ViolationPath.php | 4 +- src/Symfony/Component/Form/Form.php | 30 ++++----- src/Symfony/Component/Form/FormBuilder.php | 6 +- .../Component/Form/FormConfigBuilder.php | 4 +- .../Component/Form/FormErrorIterator.php | 4 +- src/Symfony/Component/Form/FormFactory.php | 8 +-- .../Component/Form/FormFactoryBuilder.php | 4 +- src/Symfony/Component/Form/FormRegistry.php | 8 +-- src/Symfony/Component/Form/FormRenderer.php | 4 +- src/Symfony/Component/Form/FormView.php | 4 +- .../Component/Form/NativeRequestHandler.php | 14 ++-- .../Component/Form/PreloadedExtension.php | 2 +- .../Component/Form/ResolvedFormType.php | 16 ++--- .../Form/Test/FormPerformanceTestCase.php | 2 +- .../Tests/AbstractBootstrap3LayoutTest.php | 8 +-- .../Form/Tests/AbstractLayoutTest.php | 12 ++-- .../Factory/CachingFactoryDecoratorTest.php | 4 +- .../MergeCollectionListenerTest.php | 10 +-- .../Extension/Core/Type/ChoiceTypeTest.php | 10 +-- .../Extension/Core/Type/FormTypeTest.php | 2 +- .../Csrf/Type/FormTypeCsrfExtensionTest.php | 2 +- .../DataCollector/FormDataExtractorTest.php | 2 +- .../Type/UploadValidatorExtensionTest.php | 2 +- .../ViolationMapper/ViolationPathTest.php | 4 +- .../Form/Tests/Fixtures/CustomArrayObject.php | 2 +- .../Form/Tests/Fixtures/TestExtension.php | 2 +- .../Component/Form/Tests/FormRegistryTest.php | 10 +-- .../Tests/Resources/TranslationFilesTest.php | 6 +- .../Component/Form/Util/OrderedHashMap.php | 2 +- .../Form/Util/OrderedHashMapIterator.php | 2 +- .../Component/Form/Util/ServerParams.php | 4 +- .../Form/Util/VirtualFormAwareIterator.php | 2 +- .../HttpFoundation/AcceptHeaderItem.php | 4 +- .../HttpFoundation/ApacheRequest.php | 2 +- .../HttpFoundation/BinaryFileResponse.php | 8 +-- .../Exception/UnexpectedTypeException.php | 2 +- .../MimeType/FileBinaryMimeTypeGuesser.php | 2 +- .../File/MimeType/FileinfoMimeTypeGuesser.php | 2 +- .../HttpFoundation/File/UploadedFile.php | 4 +- .../Component/HttpFoundation/FileBag.php | 8 +-- .../Component/HttpFoundation/HeaderBag.php | 6 +- .../Component/HttpFoundation/IpUtils.php | 4 +- .../Component/HttpFoundation/JsonResponse.php | 8 +-- .../Component/HttpFoundation/ParameterBag.php | 12 ++-- .../Component/HttpFoundation/Request.php | 50 +++++++-------- .../HttpFoundation/RequestMatcher.php | 6 +- .../Component/HttpFoundation/RequestStack.php | 2 +- .../Component/HttpFoundation/Response.php | 18 +++--- .../HttpFoundation/ResponseHeaderBag.php | 6 +- .../Component/HttpFoundation/ServerBag.php | 2 +- .../Session/Attribute/AttributeBag.php | 2 +- .../Attribute/NamespacedAttributeBag.php | 4 +- .../HttpFoundation/Session/Session.php | 2 +- .../Storage/Handler/PdoSessionHandler.php | 8 +-- .../HttpFoundation/StreamedResponse.php | 4 +- .../Tests/File/UploadedFileTest.php | 2 +- .../HttpFoundation/Tests/HeaderBagTest.php | 4 +- .../HttpFoundation/Tests/IpUtilsTest.php | 4 +- .../HttpFoundation/Tests/JsonResponseTest.php | 2 +- .../HttpFoundation/Tests/ParameterBagTest.php | 4 +- .../HttpFoundation/Tests/ResponseTest.php | 4 +- .../Session/Attribute/AttributeBagTest.php | 4 +- .../Tests/Session/Flash/FlashBagTest.php | 2 +- .../Tests/Session/SessionTest.php | 2 +- .../Handler/MemcacheSessionHandlerTest.php | 2 +- .../Handler/MemcachedSessionHandlerTest.php | 2 +- .../Handler/MongoDbSessionHandlerTest.php | 4 +- .../Storage/Handler/PdoSessionHandlerTest.php | 8 +-- .../Storage/NativeSessionStorageTest.php | 2 +- .../Component/HttpKernel/Bundle/Bundle.php | 8 +-- .../HttpKernel/CacheWarmer/CacheWarmer.php | 2 +- src/Symfony/Component/HttpKernel/Client.php | 4 +- .../Controller/ControllerResolver.php | 24 +++---- .../DataCollector/ConfigDataCollector.php | 12 ++-- .../DataCollector/DumpDataCollector.php | 6 +- .../DataCollector/LoggerDataCollector.php | 10 +-- .../DataCollector/MemoryDataCollector.php | 4 +- .../DataCollector/RequestDataCollector.php | 14 ++-- .../DataCollector/Util/ValueExporter.php | 12 ++-- .../LazyLoadingFragmentHandler.php | 2 +- .../MergeExtensionConfigurationPass.php | 2 +- .../Event/FilterControllerEvent.php | 10 +-- .../EventListener/DebugHandlersListener.php | 8 +-- .../EventListener/ExceptionListener.php | 6 +- .../EventListener/LocaleListener.php | 4 +- .../EventListener/ProfilerListener.php | 2 +- .../AbstractSurrogateFragmentRenderer.php | 2 +- .../HttpKernel/Fragment/FragmentHandler.php | 8 +-- .../Fragment/HIncludeFragmentRenderer.php | 6 +- .../Fragment/RoutableFragmentRenderer.php | 2 +- .../Component/HttpKernel/HttpCache/Esi.php | 2 +- .../HttpKernel/HttpCache/HttpCache.php | 10 +-- .../Component/HttpKernel/HttpCache/Ssi.php | 2 +- .../Component/HttpKernel/HttpCache/Store.php | 10 +-- .../Component/HttpKernel/HttpKernel.php | 8 +-- src/Symfony/Component/HttpKernel/Kernel.php | 14 ++-- .../Profiler/BaseMemcacheProfilerStorage.php | 2 +- .../Profiler/FileProfilerStorage.php | 4 +- .../Profiler/MysqlProfilerStorage.php | 2 +- .../Profiler/PdoProfilerStorage.php | 4 +- .../HttpKernel/Profiler/Profiler.php | 2 +- .../Profiler/RedisProfilerStorage.php | 4 +- .../Profiler/SqliteProfilerStorage.php | 8 +-- .../Tests/CacheWarmer/CacheWarmerTest.php | 4 +- .../Component/HttpKernel/Tests/ClientTest.php | 2 +- .../DataCollector/ConfigDataCollectorTest.php | 12 ++-- .../DataCollector/DumpDataCollectorTest.php | 2 +- .../EventListener/ExceptionListenerTest.php | 6 +- .../Tests/Fragment/FragmentHandlerTest.php | 2 +- .../HttpKernel/Tests/HttpCache/EsiTest.php | 4 +- .../Tests/HttpCache/HttpCacheTest.php | 6 +- .../Tests/HttpCache/HttpCacheTestCase.php | 2 +- .../HttpKernel/Tests/HttpCache/SsiTest.php | 4 +- .../Component/HttpKernel/Tests/KernelTest.php | 4 +- .../Tests/Profiler/Mock/MemcacheMock.php | 2 +- .../Tests/Profiler/Mock/RedisMock.php | 4 +- .../Data/Bundle/Reader/BundleEntryReader.php | 4 +- .../Data/Bundle/Reader/JsonBundleReader.php | 2 +- .../Data/Bundle/Reader/PhpBundleReader.php | 2 +- .../Data/Bundle/Writer/TextBundleWriter.php | 12 ++-- .../Data/Generator/LanguageDataGenerator.php | 2 +- .../Data/Generator/LocaleDataGenerator.php | 8 +-- .../Data/Generator/RegionDataGenerator.php | 2 +- .../Intl/Data/Util/RecursiveArrayAccess.php | 2 +- .../DateFormat/FullTransformer.php | 10 +-- .../DateFormat/MonthTransformer.php | 2 +- .../DateFormat/TimeZoneTransformer.php | 4 +- .../Intl/DateFormatter/IntlDateFormatter.php | 12 ++-- .../Exception/UnexpectedTypeException.php | 2 +- src/Symfony/Component/Intl/Intl.php | 2 +- src/Symfony/Component/Intl/Locale.php | 8 +-- .../Intl/NumberFormatter/NumberFormatter.php | 16 ++--- .../Bundle/Reader/BundleEntryReaderTest.php | 12 ++-- .../Bundle/Reader/IntlBundleReaderTest.php | 4 +- .../AbstractIntlDateFormatterTest.php | 26 ++++---- .../Intl/Tests/Locale/LocaleTest.php | 4 +- .../Tests/Locale/Verification/LocaleTest.php | 4 +- .../Component/Intl/Tests/LocaleTest.php | 2 +- .../AbstractNumberFormatterTest.php | 2 +- .../Component/Intl/Util/IcuVersion.php | 2 +- .../Component/Intl/Util/IntlTestHelper.php | 2 +- src/Symfony/Component/Ldap/LdapClient.php | 8 +-- .../OptionsResolver/OptionsResolver.php | 38 +++++------ .../Tests/OptionsResolver2Dot6Test.php | 2 +- .../Component/Process/PhpExecutableFinder.php | 6 +- .../Component/Process/Pipes/AbstractPipes.php | 4 +- .../Component/Process/Pipes/WindowsPipes.php | 2 +- src/Symfony/Component/Process/Process.php | 16 ++--- .../Component/Process/ProcessBuilder.php | 4 +- .../Component/Process/ProcessUtils.php | 8 +-- .../Process/Tests/ExecutableFinderTest.php | 8 +-- .../Process/Tests/PhpExecutableFinderTest.php | 10 +-- .../Component/Process/Tests/ProcessTest.php | 14 ++-- .../Exception/UnexpectedTypeException.php | 6 +- .../PropertyAccess/PropertyAccessor.php | 64 +++++++++---------- .../Component/PropertyAccess/PropertyPath.php | 8 +-- .../PropertyAccess/PropertyPathBuilder.php | 8 +-- .../Component/PropertyAccess/StringUtil.php | 4 +- .../Fixtures/NonTraversableArrayObject.php | 2 +- .../Tests/Fixtures/TraversableArrayObject.php | 2 +- .../Tests/PropertyAccessorCollectionTest.php | 2 +- .../PropertyAccess/Tests/StringUtilTest.php | 4 +- .../Extractor/SerializerExtractor.php | 2 +- src/Symfony/Component/PropertyInfo/Type.php | 2 +- .../Component/Routing/Annotation/Route.php | 10 +-- .../Routing/Generator/UrlGenerator.php | 6 +- .../Routing/Loader/AnnotationClassLoader.php | 2 +- .../Loader/AnnotationDirectoryLoader.php | 4 +- .../Routing/Loader/AnnotationFileLoader.php | 8 +-- .../Routing/Loader/ObjectRouteLoader.php | 14 ++-- .../Routing/Loader/PhpFileLoader.php | 4 +- .../Routing/Loader/XmlFileLoader.php | 8 +-- .../Routing/Loader/YamlFileLoader.php | 12 ++-- .../Routing/Matcher/ApacheUrlMatcher.php | 2 +- .../Matcher/Dumper/ApacheMatcherDumper.php | 12 ++-- .../Matcher/Dumper/DumperPrefixCollection.php | 2 +- .../Matcher/Dumper/PhpMatcherDumper.php | 10 +-- .../Matcher/RedirectableUrlMatcher.php | 2 +- .../Routing/Matcher/TraceableUrlMatcher.php | 4 +- .../Component/Routing/Matcher/UrlMatcher.php | 6 +- src/Symfony/Component/Routing/Route.php | 4 +- .../Component/Routing/RouteCollection.php | 2 +- .../Component/Routing/RouteCompiler.php | 20 +++--- .../Dumper/PhpGeneratorDumperTest.php | 2 +- .../Loader/AnnotationClassLoaderTest.php | 6 +- .../Loader/AnnotationDirectoryLoaderTest.php | 4 +- .../AuthenticationProviderManager.php | 4 +- .../Authentication/Token/AbstractToken.php | 10 +-- .../Token/UsernamePasswordToken.php | 2 +- .../Authorization/AccessDecisionManager.php | 2 +- .../Authorization/AuthorizationChecker.php | 2 +- .../ExpressionLanguageProvider.php | 2 +- .../Authorization/Voter/AbstractVoter.php | 4 +- .../Core/Authorization/Voter/RoleVoter.php | 2 +- .../Core/Encoder/BasePasswordEncoder.php | 4 +- .../Security/Core/Encoder/EncoderFactory.php | 4 +- .../Encoder/MessageDigestPasswordEncoder.php | 2 +- .../Core/Encoder/Pbkdf2PasswordEncoder.php | 2 +- .../Tests/Authorization/Voter/VoterTest.php | 2 +- .../Encoder/BCryptPasswordEncoderTest.php | 2 +- .../Tests/Resources/TranslationFilesTest.php | 6 +- .../Security/Core/User/ChainUserProvider.php | 2 +- .../Core/User/InMemoryUserProvider.php | 2 +- .../Security/Core/User/LdapUserProvider.php | 2 +- .../Security/Core/Util/ClassUtils.php | 2 +- .../Security/Core/Util/StringUtils.php | 4 +- .../Security/Csrf/CsrfTokenManager.php | 6 +- .../TokenGenerator/UriSafeTokenGenerator.php | 4 +- .../Firewall/GuardAuthenticationListener.php | 22 +++---- .../Guard/GuardAuthenticatorHandler.php | 8 +-- .../Provider/GuardAuthenticationProvider.php | 8 +-- .../SimpleAuthenticationHandler.php | 8 +-- .../Http/Firewall/ContextListener.php | 8 +-- .../Firewall/DigestAuthenticationListener.php | 2 +- .../SimplePreAuthenticationListener.php | 8 +-- ...namePasswordFormAuthenticationListener.php | 2 +- .../RememberMe/AbstractRememberMeServices.php | 2 +- ...PersistentTokenBasedRememberMeServices.php | 6 +- .../TokenBasedRememberMeServices.php | 6 +- .../AbstractRememberMeServicesTest.php | 2 +- .../Tests/Resources/TranslationFilesTest.php | 6 +- .../Normalizer/ArrayDenormalizer.php | 4 +- .../Normalizer/ObjectNormalizer.php | 2 +- .../Tests/Normalizer/CustomNormalizerTest.php | 4 +- .../Normalizer/GetSetMethodNormalizerTest.php | 4 +- .../Tests/Normalizer/ObjectNormalizerTest.php | 4 +- .../Normalizer/PropertyNormalizerTest.php | 4 +- src/Symfony/Component/Stopwatch/Stopwatch.php | 2 +- .../Component/Stopwatch/StopwatchEvent.php | 12 ++-- .../Component/Templating/Asset/UrlPackage.php | 4 +- .../Templating/Helper/SlotsHelper.php | 2 +- .../Templating/Loader/FilesystemLoader.php | 2 +- .../Component/Templating/PhpEngine.php | 8 +-- .../Catalogue/AbstractOperation.php | 6 +- .../TranslationDataCollector.php | 2 +- .../Translation/DataCollectorTranslator.php | 4 +- .../Translation/Dumper/FileDumper.php | 2 +- .../Translation/Dumper/IcuResFileDumper.php | 12 ++-- .../Translation/Dumper/JsonFileDumper.php | 2 +- .../Translation/Dumper/MoFileDumper.php | 2 +- .../Translation/Dumper/XliffFileDumper.php | 2 +- .../Extractor/AbstractFileExtractor.php | 2 +- .../Translation/Loader/ArrayLoader.php | 2 +- .../Translation/Loader/CsvFileLoader.php | 2 +- .../Translation/Loader/FileLoader.php | 2 +- .../Translation/Loader/MoFileLoader.php | 2 +- .../Translation/Loader/PoFileLoader.php | 8 +-- .../Translation/LoggingTranslator.php | 4 +- .../Component/Translation/MessageSelector.php | 2 +- .../Translation/PluralizationRules.php | 14 ++-- .../Tests/Loader/LocalizedTestCase.php | 2 +- .../Tests/PluralizationRulesTest.php | 4 +- .../Translation/Tests/TranslatorTest.php | 2 +- .../Component/Translation/Translator.php | 6 +- .../Translation/Util/ArrayConverter.php | 8 +-- .../Component/Validator/Constraint.php | 28 ++++---- .../Validator/ConstraintValidator.php | 10 +-- .../Validator/ConstraintViolation.php | 6 +- .../Validator/ConstraintViolationList.php | 2 +- .../Constraints/AbstractComparison.php | 4 +- .../AbstractComparisonValidator.php | 2 +- .../Validator/Constraints/AllValidator.php | 2 +- .../Validator/Constraints/BicValidator.php | 2 +- .../Validator/Constraints/Callback.php | 8 +-- .../Constraints/CallbackValidator.php | 14 ++-- .../Validator/Constraints/ChoiceValidator.php | 16 ++--- .../Validator/Constraints/Collection.php | 6 +- .../Constraints/CollectionValidator.php | 6 +- .../Validator/Constraints/Composite.php | 16 ++--- .../Component/Validator/Constraints/Count.php | 2 +- .../Validator/Constraints/CountValidator.php | 4 +- .../Constraints/CountryValidator.php | 2 +- .../Constraints/CurrencyValidator.php | 2 +- .../Constraints/DateTimeValidator.php | 2 +- .../Validator/Constraints/DateValidator.php | 2 +- .../Validator/Constraints/EmailValidator.php | 2 +- .../Constraints/ExpressionValidator.php | 2 +- .../Validator/Constraints/FileValidator.php | 4 +- .../Validator/Constraints/GroupSequence.php | 2 +- .../Validator/Constraints/IbanValidator.php | 4 +- .../Validator/Constraints/ImageValidator.php | 4 +- .../Component/Validator/Constraints/Ip.php | 2 +- .../Validator/Constraints/IpValidator.php | 2 +- .../Validator/Constraints/IsbnValidator.php | 4 +- .../Validator/Constraints/IssnValidator.php | 4 +- .../Constraints/LanguageValidator.php | 2 +- .../Validator/Constraints/Length.php | 2 +- .../Validator/Constraints/LengthValidator.php | 2 +- .../Validator/Constraints/LocaleValidator.php | 4 +- .../Validator/Constraints/LuhnValidator.php | 4 +- .../Validator/Constraints/RangeValidator.php | 4 +- .../Component/Validator/Constraints/Regex.php | 4 +- .../Validator/Constraints/RegexValidator.php | 2 +- .../Validator/Constraints/TimeValidator.php | 2 +- .../Validator/Constraints/Traverse.php | 2 +- .../Validator/Constraints/TypeValidator.php | 4 +- .../Validator/Constraints/UrlValidator.php | 4 +- .../Validator/Constraints/UuidValidator.php | 4 +- .../Component/Validator/Constraints/Valid.php | 4 +- .../Validator/Context/ExecutionContext.php | 6 +- .../Exception/UnexpectedTypeException.php | 2 +- .../Component/Validator/ExecutionContext.php | 6 +- .../Validator/Mapping/Cache/ApcCache.php | 4 +- .../Validator/Mapping/ClassMetadata.php | 18 +++--- .../Factory/LazyLoadingMetadataFactory.php | 10 +-- .../Validator/Mapping/GenericMetadata.php | 4 +- .../Validator/Mapping/Loader/LoaderChain.php | 2 +- .../Mapping/Loader/XmlFileLoader.php | 28 ++++---- .../Mapping/Loader/YamlFileLoader.php | 14 ++-- .../Validator/Mapping/MemberMetadata.php | 6 +- .../Validator/Mapping/PropertyMetadata.php | 2 +- .../AbstractComparisonValidatorTestCase.php | 2 +- .../AbstractConstraintValidatorTest.php | 14 ++-- .../Constraints/CardSchemeValidatorTest.php | 2 +- .../Tests/Constraints/CountValidatorTest.php | 8 +-- .../Tests/Constraints/FileValidatorTest.php | 2 +- .../Tests/Constraints/IsbnValidatorTest.php | 4 +- .../Validator/Tests/Fixtures/Countable.php | 2 +- .../Tests/Fixtures/CustomArrayObject.php | 2 +- .../Tests/Fixtures/FakeMetadataFactory.php | 16 ++--- .../Tests/Resources/TranslationFilesTest.php | 6 +- .../Tests/Validator/Abstract2Dot5ApiTest.php | 6 +- .../Tests/Validator/AbstractValidatorTest.php | 4 +- .../Component/Validator/ValidationVisitor.php | 6 +- src/Symfony/Component/Validator/Validator.php | 12 ++-- .../RecursiveContextualValidator.php | 44 ++++++------- .../Validator/RecursiveValidator.php | 8 +-- .../Component/Validator/ValidatorBuilder.php | 16 ++--- .../Component/VarDumper/Caster/Caster.php | 4 +- .../VarDumper/Caster/CutArrayStub.php | 2 +- .../Component/VarDumper/Caster/CutStub.php | 8 +-- .../VarDumper/Caster/ExceptionCaster.php | 12 ++-- .../Component/VarDumper/Caster/PdoCaster.php | 2 +- .../Component/VarDumper/Caster/StubCaster.php | 2 +- .../VarDumper/Cloner/AbstractCloner.php | 8 +-- .../Component/VarDumper/Cloner/Data.php | 10 +-- .../Component/VarDumper/Cloner/VarCloner.php | 20 +++--- .../VarDumper/Dumper/AbstractDumper.php | 10 +-- .../Component/VarDumper/Dumper/CliDumper.php | 22 +++---- .../Component/VarDumper/Dumper/HtmlDumper.php | 4 +- .../Exception/ThrowingCasterException.php | 2 +- .../Tests/Caster/ExceptionCasterTest.php | 6 +- .../Tests/Caster/ReflectionCasterTest.php | 2 +- .../VarDumper/Tests/CliDumperTest.php | 8 +-- .../VarDumper/Tests/HtmlDumperTest.php | 2 +- src/Symfony/Component/VarDumper/VarDumper.php | 4 +- src/Symfony/Component/Yaml/Dumper.php | 4 +- src/Symfony/Component/Yaml/Escaper.php | 2 +- src/Symfony/Component/Yaml/Inline.php | 32 +++++----- src/Symfony/Component/Yaml/Parser.php | 28 ++++---- src/Symfony/Component/Yaml/Unescaper.php | 8 +-- 719 files changed, 2258 insertions(+), 2256 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index 2fcc078ebb4e0..7138413855ef3 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -17,6 +17,8 @@ return PhpCsFixer\Config::create() 'self_accessor' => false, // TODO remove the disabling once https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3876 is merged and released 'native_constant_invocation' => false, + // Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading + 'native_function_invocation' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'), )) ->setRiskyAllowed(true) ->setFinder( diff --git a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php index 895ade5fe740e..baa99fac5d3d0 100644 --- a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php +++ b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php @@ -54,7 +54,7 @@ public function dispatchEvent($eventName, EventArgs $eventArgs = null) $initialized = isset($this->initialized[$eventName]); foreach ($this->listeners[$eventName] as $hash => $listener) { - if (!$initialized && is_string($listener)) { + if (!$initialized && \is_string($listener)) { $this->listeners[$eventName][$hash] = $listener = $this->container->get($listener); } @@ -98,7 +98,7 @@ public function hasListeners($event) */ public function addEventListener($events, $listener) { - if (is_string($listener)) { + if (\is_string($listener)) { if ($this->initialized) { throw new \RuntimeException('Adding lazy-loading listeners after construction is not supported.'); } @@ -124,7 +124,7 @@ public function addEventListener($events, $listener) */ public function removeEventListener($events, $listener) { - if (is_string($listener)) { + if (\is_string($listener)) { $hash = '_service_'.$listener; } else { // Picks the hash code related to that listener diff --git a/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php b/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php index a57b9ae6ea151..2580c1b88dc9d 100644 --- a/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php +++ b/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php @@ -120,14 +120,14 @@ private function sanitizeQuery($connectionName, $query) if (null === $query['params']) { $query['params'] = array(); } - if (!is_array($query['params'])) { + if (!\is_array($query['params'])) { $query['params'] = array($query['params']); } foreach ($query['params'] as $j => $param) { if (isset($query['types'][$j])) { // Transform the param according to the type $type = $query['types'][$j]; - if (is_string($type)) { + if (\is_string($type)) { $type = Type::getType($type); } if ($type instanceof Type) { @@ -158,11 +158,11 @@ private function sanitizeQuery($connectionName, $query) */ private function sanitizeParam($var) { - if (is_object($var)) { - return array(sprintf('Object(%s)', get_class($var)), false); + if (\is_object($var)) { + return array(sprintf('Object(%s)', \get_class($var)), false); } - if (is_array($var)) { + if (\is_array($var)) { $a = array(); $original = true; foreach ($var as $k => $v) { @@ -174,7 +174,7 @@ private function sanitizeParam($var) return array($a, $original); } - if (is_resource($var)) { + if (\is_resource($var)) { return array(sprintf('Resource(%s)', get_resource_type($var)), false); } diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index 8426d307da5da..ac79c576afea7 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -142,7 +142,7 @@ protected function setMappingDriverConfig(array $mappingConfig, $mappingName) */ protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \ReflectionClass $bundle, ContainerBuilder $container) { - $bundleDir = dirname($bundle->getFileName()); + $bundleDir = \dirname($bundle->getFileName()); if (!$bundleConfig['type']) { $bundleConfig['type'] = $this->detectMetadataDriver($bundleDir, $container); @@ -154,7 +154,7 @@ protected function getMappingDriverBundleConfigDefaults(array $bundleConfig, \Re } if (!$bundleConfig['dir']) { - if (in_array($bundleConfig['type'], array('annotation', 'staticphp'))) { + if (\in_array($bundleConfig['type'], array('annotation', 'staticphp'))) { $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingObjectDefaultName(); } else { $bundleConfig['dir'] = $bundleDir.'/'.$this->getMappingResourceConfigDirectory(); @@ -241,7 +241,7 @@ protected function assertValidMappingConfiguration(array $mappingConfig, $object throw new \InvalidArgumentException(sprintf('Specified non-existing directory "%s" as Doctrine mapping source.', $mappingConfig['dir'])); } - if (!in_array($mappingConfig['type'], array('xml', 'yml', 'annotation', 'php', 'staticphp'))) { + if (!\in_array($mappingConfig['type'], array('xml', 'yml', 'annotation', 'php', 'staticphp'))) { throw new \InvalidArgumentException(sprintf('Can only configure "xml", "yml", "annotation", "php" or '. '"staticphp" through the DoctrineBundle. Use your own bundle to configure other metadata drivers. '. 'You can register them by adding a new driver to the '. @@ -264,17 +264,17 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container) $configPath = $this->getMappingResourceConfigDirectory(); $resource = $dir.'/'.$configPath; while (!is_dir($resource)) { - $resource = dirname($resource); + $resource = \dirname($resource); } $container->addResource(new FileResource($resource)); $extension = $this->getMappingResourceExtension(); - if (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) && count($files)) { + if (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) && \count($files)) { return 'xml'; - } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.yml')) && count($files)) { + } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.yml')) && \count($files)) { return 'yml'; - } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.php')) && count($files)) { + } elseif (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.php')) && \count($files)) { return 'php'; } diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php index 82c1b7c811386..4b030955a98f5 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php @@ -60,7 +60,7 @@ private function updateValidatorMappingFiles(ContainerBuilder $container, $mappi foreach ($container->getParameter('kernel.bundles') as $bundle) { $reflection = new \ReflectionClass($bundle); - if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) { + if (is_file($file = \dirname($reflection->getFileName()).'/'.$validationPath)) { $files[] = $file; $container->addResource(new FileResource($file)); } diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php index f7d513a14e09a..2ba7747e3881f 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -153,7 +153,7 @@ private function findAndSortTags($tagName, ContainerBuilder $container) if ($sortedTags) { krsort($sortedTags); - $sortedTags = call_user_func_array('array_merge', $sortedTags); + $sortedTags = \call_user_func_array('array_merge', $sortedTags); } return $sortedTags; diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php index 6ec2407d90737..ac3a55e481d9a 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -124,7 +124,7 @@ public function __construct($driver, array $namespaces, array $managerParameters $this->managerParameters = $managerParameters; $this->driverPattern = $driverPattern; $this->enabledParameter = $enabledParameter; - if (count($aliasMap) && (!$configurationPattern || !$registerAliasMethodName)) { + if (\count($aliasMap) && (!$configurationPattern || !$registerAliasMethodName)) { throw new \InvalidArgumentException('configurationPattern and registerAliasMethodName are required to register namespace alias'); } $this->configurationPattern = $configurationPattern; @@ -149,7 +149,7 @@ public function process(ContainerBuilder $container) $chainDriverDef->addMethodCall('addDriver', array($mappingDriverDef, $namespace)); } - if (!count($this->aliasMap)) { + if (!\count($this->aliasMap)) { return; } diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php index bf5890c1e69f0..43120c6258577 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -88,7 +88,7 @@ public function loadValuesForChoices(array $choices, $value = null) // Optimize performance for single-field identifiers. We already // know that the IDs are used as values - $optimize = null === $value || is_array($value) && $value[0] === $this->idReader; + $optimize = null === $value || \is_array($value) && $value[0] === $this->idReader; // Attention: This optimization does not check choices for existence if ($optimize && !$this->choiceList && $this->idReader->isSingleId()) { @@ -125,7 +125,7 @@ public function loadChoicesForValues(array $values, $value = null) // Optimize performance in case we have an object loader and // a single-field identifier - $optimize = null === $value || is_array($value) && $value[0] === $this->idReader; + $optimize = null === $value || \is_array($value) && $value[0] === $this->idReader; if ($optimize && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) { $unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values); diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 2c226f50a0ad5..b196e8918344c 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -117,7 +117,7 @@ public function __construct(ObjectManager $manager, $class, $labelPath = null, E $this->entityLoader = $entityLoader; $this->classMetadata = $manager->getClassMetadata($class); $this->class = $this->classMetadata->getName(); - $this->loaded = is_array($entities) || $entities instanceof \Traversable; + $this->loaded = \is_array($entities) || $entities instanceof \Traversable; $this->preferredEntities = $preferredEntities; list( $this->idAsIndex, @@ -449,13 +449,13 @@ private function getIdentifierInfoForClass(ClassMetadata $classMetadata) $identifiers = $classMetadata->getIdentifierFieldNames(); - if (1 === count($identifiers)) { + if (1 === \count($identifiers)) { $identifier = $identifiers[0]; if (!$classMetadata->hasAssociation($identifier)) { $idAsValue = true; - if (in_array($classMetadata->getTypeOfField($identifier), array('integer', 'smallint', 'bigint'))) { + if (\in_array($classMetadata->getTypeOfField($identifier), array('integer', 'smallint', 'bigint'))) { $idAsIndex = true; } } diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php index 1d881849267d7..9c632330354b1 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php @@ -42,8 +42,8 @@ public function __construct(ObjectManager $om, ClassMetadata $classMetadata) $this->om = $om; $this->classMetadata = $classMetadata; - $this->singleId = 1 === count($ids); - $this->intId = $this->singleId && in_array($idType, array('integer', 'smallint', 'bigint')); + $this->singleId = 1 === \count($ids); + $this->intId = $this->singleId && \in_array($idType, array('integer', 'smallint', 'bigint')); $this->idField = current($ids); // single field association are resolved, since the schema column could be an int @@ -95,7 +95,7 @@ public function getIdValue($object) } if (!$this->om->contains($object)) { - throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', get_class($object))); + throw new RuntimeException(sprintf('Entity of type "%s" passed to the choice field must be managed. Maybe you forget to persist it in the entity manager?', \get_class($object))); } $this->om->initializeObject($object); diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php index c9a02fb38d764..0a0de20c573ce 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php @@ -98,7 +98,7 @@ public function getEntitiesByIds($identifier, array $values) // Guess type $entity = current($qb->getRootEntities()); $metadata = $qb->getEntityManager()->getClassMetadata($entity); - if (in_array($metadata->getTypeOfField($identifier), array('integer', 'bigint', 'smallint'))) { + if (\in_array($metadata->getTypeOfField($identifier), array('integer', 'bigint', 'smallint'))) { $parameterType = Connection::PARAM_INT_ARRAY; // Filter out non-integer values (e.g. ""). If we don't, some @@ -106,7 +106,7 @@ public function getEntitiesByIds($identifier, array $values) $values = array_values(array_filter($values, function ($v) { return (string) $v === (string) (int) $v || ctype_digit($v); })); - } elseif (in_array($metadata->getTypeOfField($identifier), array('uuid', 'guid'))) { + } elseif (\in_array($metadata->getTypeOfField($identifier), array('uuid', 'guid'))) { $parameterType = Connection::PARAM_STR_ARRAY; // Like above, but we just filter out empty strings. diff --git a/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php b/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php index 307361a52a3ef..63c8f2439b9a3 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php +++ b/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php @@ -36,7 +36,7 @@ public function transform($collection) // For cases when the collection getter returns $collection->toArray() // in order to prevent modifications of the returned collection - if (is_array($collection)) { + if (\is_array($collection)) { return $collection; } diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 645e2fda4cc67..a1b614944e2fd 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -131,7 +131,7 @@ public function guessMaxLength($class, $property) return new ValueGuess($mapping['length'], Guess::HIGH_CONFIDENCE); } - if (in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { + if (\in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); } } @@ -144,7 +144,7 @@ public function guessPattern($class, $property) { $ret = $this->getMetadata($class); if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) { - if (in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { + if (\in_array($ret[0]->getTypeOfField($property), array(Type::DECIMAL, Type::FLOAT))) { return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); } } diff --git a/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php b/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php index bb4cfa5087c49..8f96f3677c8b9 100644 --- a/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php +++ b/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php @@ -41,7 +41,7 @@ public function onBind(FormEvent $event) // If all items were removed, call clear which has a higher // performance on persistent collections - if ($collection instanceof Collection && 0 === count($data)) { + if ($collection instanceof Collection && 0 === \count($data)) { $collection->clear(); } } diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 2acf7176f1eac..f76872a5818c7 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -259,8 +259,8 @@ public function configureOptions(OptionsResolver $resolver) // Invoke the query builder closure so that we can cache choice lists // for equal query builders $queryBuilderNormalizer = function (Options $options, $queryBuilder) { - if (is_callable($queryBuilder)) { - $queryBuilder = call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); + if (\is_callable($queryBuilder)) { + $queryBuilder = \call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); } return $queryBuilder; diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php index 7ec1ea3d43341..99ce535e23c01 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php @@ -28,8 +28,8 @@ public function configureOptions(OptionsResolver $resolver) // Invoke the query builder closure so that we can cache choice lists // for equal query builders $queryBuilderNormalizer = function (Options $options, $queryBuilder) { - if (is_callable($queryBuilder)) { - $queryBuilder = call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); + if (\is_callable($queryBuilder)) { + $queryBuilder = \call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); if (null !== $queryBuilder && !$queryBuilder instanceof QueryBuilder) { throw new UnexpectedTypeException($queryBuilder, 'Doctrine\ORM\QueryBuilder'); diff --git a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php index 42574edcade56..9099fe06765d5 100644 --- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php +++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php @@ -71,12 +71,12 @@ private function normalizeParams(array $params) { foreach ($params as $index => $param) { // normalize recursively - if (is_array($param)) { + if (\is_array($param)) { $params[$index] = $this->normalizeParams($param); continue; } - if (!is_string($params[$index])) { + if (!\is_string($params[$index])) { continue; } diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 7356ff2998cfa..18d3e690a72b9 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -52,7 +52,7 @@ public function loadUserByUsername($username) } else { if (!$repository instanceof UserLoaderInterface) { if (!$repository instanceof UserProviderInterface) { - throw new \InvalidArgumentException(sprintf('You must either make the "%s" entity Doctrine Repository ("%s") implement "Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface" or set the "property" option in the corresponding entity provider configuration.', $this->classOrAlias, get_class($repository))); + throw new \InvalidArgumentException(sprintf('You must either make the "%s" entity Doctrine Repository ("%s") implement "Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface" or set the "property" option in the corresponding entity provider configuration.', $this->classOrAlias, \get_class($repository))); } @trigger_error('Implementing Symfony\Component\Security\Core\User\UserProviderInterface in a Doctrine repository when using the entity provider is deprecated since Symfony 2.8 and will not be supported in 3.0. Make the repository implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface instead.', E_USER_DEPRECATED); @@ -75,7 +75,7 @@ public function refreshUser(UserInterface $user) { $class = $this->getClass(); if (!$user instanceof $class) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user))); + throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); } $repository = $this->getRepository(); diff --git a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php index 1a97922b05f8b..9fa7c777a533c 100644 --- a/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php +++ b/src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php @@ -30,7 +30,7 @@ class DoctrineTestHelper */ public static function createTestEntityManager() { - if (!extension_loaded('pdo_sqlite')) { + if (!\extension_loaded('pdo_sqlite')) { TestCase::markTestSkipped('Extension pdo_sqlite is required.'); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index 0a9dae3b200fe..63109fab99e2e 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -68,7 +68,7 @@ public function testFixManagersAutoMappingsWithTwoAutomappings() 'SecondBundle' => 'My\SecondBundle', ); - $reflection = new \ReflectionClass(get_class($this->extension)); + $reflection = new \ReflectionClass(\get_class($this->extension)); $method = $reflection->getMethod('fixManagersAutoMappings'); $method->setAccessible(true); @@ -157,7 +157,7 @@ public function testFixManagersAutoMappings(array $originalEm1, array $originalE 'SecondBundle' => 'My\SecondBundle', ); - $reflection = new \ReflectionClass(get_class($this->extension)); + $reflection = new \ReflectionClass(\get_class($this->extension)); $method = $reflection->getMethod('fixManagersAutoMappings'); $method->setAccessible(true); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index ac96ea21c5312..048747c937946 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -72,7 +72,7 @@ protected function setUp() $ids = range(1, 300); foreach ($ids as $id) { - $name = 65 + (int) chr($id % 57); + $name = 65 + (int) \chr($id % 57); $this->em->persist(new SingleIntIdEntity($id, $name)); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php index 1e3e6ca6ec809..38bbed12945fe 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -145,7 +145,7 @@ public function testLogUTF8LongString() ; $testStringArray = array('é', 'á', 'ű', 'ő', 'ú', 'ö', 'ü', 'ó', 'í'); - $testStringCount = count($testStringArray); + $testStringCount = \count($testStringArray); $shortString = ''; $longString = ''; diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php index 394eaebdefc6f..8d0a9381143df 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php +++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) return; } if (!$value instanceof Foo) { - throw new ConversionException(sprintf('Expected %s, got %s', 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\Foo', gettype($value))); + throw new ConversionException(sprintf('Expected %s, got %s', 'Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\Foo', \gettype($value))); } return $foo->bar; @@ -64,7 +64,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) if (null === $value) { return; } - if (!is_string($value)) { + if (!\is_string($value)) { throw ConversionException::conversionFailed($value, self::NAME); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index 299138cf795d9..7779acaa801c7 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -176,7 +176,7 @@ public function testSupportProxy() $provider = new EntityUserProvider($this->getManager($em), 'Symfony\Bridge\Doctrine\Tests\Fixtures\User', 'name'); $user2 = $em->getReference('Symfony\Bridge\Doctrine\Tests\Fixtures\User', array('id1' => 1, 'id2' => 1)); - $this->assertTrue($provider->supportsClass(get_class($user2))); + $this->assertTrue($provider->supportsClass(\get_class($user2))); } public function testLoadUserByUserNameShouldLoadUserWhenProperInterfaceProvided() diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index f000cae75ebe3..cb08796131612 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -45,17 +45,17 @@ public function validate($entity, Constraint $constraint) throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UniqueEntity'); } - if (!is_array($constraint->fields) && !is_string($constraint->fields)) { + if (!\is_array($constraint->fields) && !\is_string($constraint->fields)) { throw new UnexpectedTypeException($constraint->fields, 'array'); } - if (null !== $constraint->errorPath && !is_string($constraint->errorPath)) { + if (null !== $constraint->errorPath && !\is_string($constraint->errorPath)) { throw new UnexpectedTypeException($constraint->errorPath, 'string or null'); } $fields = (array) $constraint->fields; - if (0 === count($fields)) { + if (0 === \count($fields)) { throw new ConstraintDefinitionException('At least one field has to be specified.'); } @@ -70,14 +70,14 @@ public function validate($entity, Constraint $constraint) throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em)); } } else { - $em = $this->registry->getManagerForClass(get_class($entity)); + $em = $this->registry->getManagerForClass(\get_class($entity)); if (!$em) { - throw new ConstraintDefinitionException(sprintf('Unable to find the object manager associated with an entity of class "%s".', get_class($entity))); + throw new ConstraintDefinitionException(sprintf('Unable to find the object manager associated with an entity of class "%s".', \get_class($entity))); } } - $class = $em->getClassMetadata(get_class($entity)); + $class = $em->getClassMetadata(\get_class($entity)); /* @var $class \Doctrine\Common\Persistence\Mapping\ClassMetadata */ $criteria = array(); @@ -120,7 +120,7 @@ public function validate($entity, Constraint $constraint) return; } - $repository = $em->getRepository(get_class($entity)); + $repository = $em->getRepository(\get_class($entity)); $result = $repository->{$constraint->repositoryMethod}($criteria); if ($result instanceof \IteratorAggregate) { diff --git a/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php b/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php index 42cafdd129472..010c051581e70 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php +++ b/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php @@ -30,7 +30,7 @@ public function __construct(ManagerRegistry $registry) public function initialize($object) { - $manager = $this->registry->getManagerForClass(get_class($object)); + $manager = $this->registry->getManagerForClass(\get_class($object)); if (null !== $manager) { $manager->initializeObject($object); } diff --git a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php index f1046c96a6ad1..4c124709eaec7 100644 --- a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php @@ -51,7 +51,7 @@ public function countErrors() $levels = array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY); foreach ($levels as $level) { if (isset($this->recordsByLevel[$level])) { - $cnt += count($this->recordsByLevel[$level]); + $cnt += \count($this->recordsByLevel[$level]); } } diff --git a/src/Symfony/Bridge/PhpUnit/ClockMock.php b/src/Symfony/Bridge/PhpUnit/ClockMock.php index 8bfb9a6211186..5cd3531d6b67d 100644 --- a/src/Symfony/Bridge/PhpUnit/ClockMock.php +++ b/src/Symfony/Bridge/PhpUnit/ClockMock.php @@ -71,7 +71,7 @@ public static function microtime($asFloat = false) public static function register($class) { - $self = get_called_class(); + $self = \get_called_class(); $mockedNs = array(substr($class, 0, strrpos($class, '\\'))); if (strpos($class, '\\Tests\\')) { @@ -79,7 +79,7 @@ public static function register($class) $mockedNs[] = substr($ns, 0, strrpos($ns, '\\')); } foreach ($mockedNs as $ns) { - if (function_exists($ns.'\time')) { + if (\function_exists($ns.'\time')) { continue; } eval(<<setAccessible(true); - $r->setValue($e, array_slice($trace, 1, $i)); + $r->setValue($e, \array_slice($trace, 1, $i)); echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':'; echo "\n".$msg; @@ -193,12 +193,12 @@ public static function register($mode = 0) // reset deprecations array foreach ($deprecations as $group => $arrayOrInt) { - $deprecations[$group] = is_int($arrayOrInt) ? 0 : array(); + $deprecations[$group] = \is_int($arrayOrInt) ? 0 : array(); } register_shutdown_function(function () use (&$deprecations, $isFailing, $displayDeprecations, $mode) { foreach ($deprecations as $group => $arrayOrInt) { - if (0 < (is_int($arrayOrInt) ? $arrayOrInt : count($arrayOrInt))) { + if (0 < (\is_int($arrayOrInt) ? $arrayOrInt : \count($arrayOrInt))) { echo "Shutdown-time deprecations:\n"; break; } @@ -222,7 +222,7 @@ public static function register($mode = 0) */ private static function hasColorSupport() { - if (!defined('STDOUT')) { + if (!\defined('STDOUT')) { return false; } @@ -231,18 +231,18 @@ private static function hasColorSupport() } if (DIRECTORY_SEPARATOR === '\\') { - return (function_exists('sapi_windows_vt100_support') + return (\function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM'); } - if (function_exists('stream_isatty')) { + if (\function_exists('stream_isatty')) { return stream_isatty(STDOUT); } - if (function_exists('posix_isatty')) { + if (\function_exists('posix_isatty')) { return posix_isatty(STDOUT); } diff --git a/src/Symfony/Bridge/PhpUnit/TextUI/Command.php b/src/Symfony/Bridge/PhpUnit/TextUI/Command.php index 7f218af9a39ff..82d6ab32e03c2 100644 --- a/src/Symfony/Bridge/PhpUnit/TextUI/Command.php +++ b/src/Symfony/Bridge/PhpUnit/TextUI/Command.php @@ -38,7 +38,7 @@ protected function handleBootstrap($filename) // By default, we want PHPUnit's autoloader before Symfony's one if (!getenv('SYMFONY_PHPUNIT_OVERLOAD')) { $filename = realpath(stream_resolve_include_path($filename)); - $symfonyLoader = realpath(dirname(PHPUNIT_COMPOSER_INSTALL).'/../../../vendor/autoload.php'); + $symfonyLoader = realpath(\dirname(PHPUNIT_COMPOSER_INSTALL).'/../../../vendor/autoload.php'); if ($filename === $symfonyLoader) { $symfonyLoader = require $symfonyLoader; diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php index 33fc49e1012d9..7d083a6981e25 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php @@ -51,7 +51,7 @@ public function instantiateProxy(ContainerInterface $container, Definition $defi return $this->factory->createProxy( $definition->getClass(), function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($realInstantiator) { - $wrappedInstance = call_user_func($realInstantiator); + $wrappedInstance = \call_user_func($realInstantiator); $proxy->setProxyInitializer(null); diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index e749ad40e0742..662c274f783fb 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -57,7 +57,7 @@ public function getProxyFactoryCode(Definition $definition, $id) if ($definition->isShared()) { $instantiation .= " \$this->services['$id'] ="; - if (defined('Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER') && ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope(false)) { + if (\defined('Symfony\Component\DependencyInjection\ContainerInterface::SCOPE_CONTAINER') && ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope(false)) { $instantiation .= " \$this->scopedServices['$scope']['$id'] ="; } } diff --git a/src/Symfony/Bridge/Twig/AppVariable.php b/src/Symfony/Bridge/Twig/AppVariable.php index dbbee30a471f9..cdad4b8ee0f86 100644 --- a/src/Symfony/Bridge/Twig/AppVariable.php +++ b/src/Symfony/Bridge/Twig/AppVariable.php @@ -103,7 +103,7 @@ public function getUser() } $user = $token->getUser(); - if (is_object($user)) { + if (\is_object($user)) { return $user; } } diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index b7ba43fa3d348..a9c50db50a7c6 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -139,16 +139,16 @@ private function getMetadata($type, $entity) if (null === $cb) { return; } - if (is_array($cb)) { + if (\is_array($cb)) { if (!method_exists($cb[0], $cb[1])) { return; } $refl = new \ReflectionMethod($cb[0], $cb[1]); - } elseif (is_object($cb) && method_exists($cb, '__invoke')) { + } elseif (\is_object($cb) && method_exists($cb, '__invoke')) { $refl = new \ReflectionMethod($cb, '__invoke'); - } elseif (function_exists($cb)) { + } elseif (\function_exists($cb)) { $refl = new \ReflectionFunction($cb); - } elseif (is_string($cb) && preg_match('{^(.+)::(.+)$}', $cb, $m) && method_exists($m[1], $m[2])) { + } elseif (\is_string($cb) && preg_match('{^(.+)::(.+)$}', $cb, $m) && method_exists($m[1], $m[2])) { $refl = new \ReflectionMethod($m[1], $m[2]); } else { throw new \UnexpectedValueException('Unsupported callback type'); @@ -198,8 +198,8 @@ private function getPrettyMetadata($type, $entity) } if ('globals' === $type) { - if (is_object($meta)) { - return ' = object('.get_class($meta).')'; + if (\is_object($meta)) { + return ' = object('.\get_class($meta).')'; } return ' = '.substr(@json_encode($meta), 0, 50); diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 2c312c58e53ec..3a0fffca6f276 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $filenames = $input->getArgument('filename'); - if (0 === count($filenames)) { + if (0 === \count($filenames)) { if (0 !== ftell(STDIN)) { throw new \RuntimeException('Please provide a filename or pipe template content to STDIN.'); } @@ -184,9 +184,9 @@ private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInf } if (0 === $errors) { - $io->success(sprintf('All %d Twig files contain valid syntax.', count($filesInfo))); + $io->success(sprintf('All %d Twig files contain valid syntax.', \count($filesInfo))); } else { - $io->warning(sprintf('%d Twig files have valid syntax and %d contain errors.', count($filesInfo) - $errors, $errors)); + $io->warning(sprintf('%d Twig files have valid syntax and %d contain errors.', \count($filesInfo) - $errors, $errors)); } return min($errors, 1); @@ -206,7 +206,7 @@ private function displayJson(OutputInterface $output, $filesInfo) } }); - $output->writeln(json_encode($filesInfo, defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0)); + $output->writeln(json_encode($filesInfo, \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0)); return min($errors, 1); } @@ -239,7 +239,7 @@ private function getContext($template, $line, $context = 3) $lines = explode("\n", $template); $position = max(0, $line - $context); - $max = min(count($lines), $line - 1 + $context); + $max = min(\count($lines), $line - 1 + $context); $result = array(); while ($position < $max) { diff --git a/src/Symfony/Bridge/Twig/Extension/AssetExtension.php b/src/Symfony/Bridge/Twig/Extension/AssetExtension.php index 40974686adda4..271d71ad2bbec 100644 --- a/src/Symfony/Bridge/Twig/Extension/AssetExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/AssetExtension.php @@ -62,13 +62,13 @@ public function getFunctions() public function getAssetUrl($path, $packageName = null, $absolute = false, $version = null) { // BC layer to be removed in 3.0 - if (2 < $count = func_num_args()) { + if (2 < $count = \func_num_args()) { @trigger_error('Generating absolute URLs with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0. Please use absolute_url() instead.', E_USER_DEPRECATED); if (4 === $count) { @trigger_error('Forcing a version with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0.', E_USER_DEPRECATED); } - $args = func_get_args(); + $args = \func_get_args(); return $this->getLegacyAssetUrl($path, $packageName, $args[2], isset($args[3]) ? $args[3] : null); } diff --git a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php index e6fc9298fa7db..865befd3ba858 100644 --- a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php @@ -33,7 +33,7 @@ class CodeExtension extends AbstractExtension public function __construct($fileLinkFormat, $rootDir, $charset) { $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - $this->rootDir = str_replace('/', DIRECTORY_SEPARATOR, dirname($rootDir)).DIRECTORY_SEPARATOR; + $this->rootDir = str_replace('/', DIRECTORY_SEPARATOR, \dirname($rootDir)).DIRECTORY_SEPARATOR; $this->charset = $charset; } @@ -92,7 +92,7 @@ public function formatArgs($args) $short = array_pop($parts); $formattedValue = sprintf('object(%s)', $item[1], $short); } elseif ('array' === $item[0]) { - $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + $formattedValue = sprintf('array(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->charset)); } elseif ('null' === $item[0]) { @@ -105,7 +105,7 @@ public function formatArgs($args) $formattedValue = str_replace("\n", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES, $this->charset), true)); } - $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); + $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); @@ -142,7 +142,7 @@ public function fileExcerpt($file, $line) $content = explode('
', $code); $lines = array(); - for ($i = max($line - 3, 1), $max = min($line + 3, count($content)); $i <= $max; ++$i) { + for ($i = max($line - 3, 1), $max = min($line + 3, \count($content)); $i <= $max; ++$i) { $lines[] = ''.self::fixCodeMarkup($content[$i - 1]).''; } @@ -166,7 +166,7 @@ public function formatFile($file, $line, $text = null) if (null === $text) { $text = str_replace('/', DIRECTORY_SEPARATOR, $file); if (0 === strpos($text, $this->rootDir)) { - $text = substr($text, strlen($this->rootDir)); + $text = substr($text, \strlen($this->rootDir)); $text = explode(DIRECTORY_SEPARATOR, $text, 2); $text = sprintf('%s%s', $this->rootDir, $text[0], isset($text[1]) ? DIRECTORY_SEPARATOR.$text[1] : ''); } diff --git a/src/Symfony/Bridge/Twig/Extension/DumpExtension.php b/src/Symfony/Bridge/Twig/Extension/DumpExtension.php index eddd4d7f2afa0..70be3e9127d95 100644 --- a/src/Symfony/Bridge/Twig/Extension/DumpExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/DumpExtension.php @@ -56,7 +56,7 @@ public function dump(Environment $env, $context) return; } - if (2 === func_num_args()) { + if (2 === \func_num_args()) { $vars = array(); foreach ($context as $key => $value) { if (!$value instanceof Template) { @@ -66,7 +66,7 @@ public function dump(Environment $env, $context) $vars = array($vars); } else { - $vars = func_get_args(); + $vars = \func_get_args(); unset($vars[0], $vars[1]); } diff --git a/src/Symfony/Bridge/Twig/Extension/FormExtension.php b/src/Symfony/Bridge/Twig/Extension/FormExtension.php index ab7c6ab626d8c..552b39c2b93f4 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -152,8 +152,8 @@ public function humanize($text) */ public function isSelectedChoice(ChoiceView $choice, $selectedValue) { - if (is_array($selectedValue)) { - return in_array($choice->value, $selectedValue, true); + if (\is_array($selectedValue)) { + return \in_array($choice->value, $selectedValue, true); } return $choice->value === $selectedValue; diff --git a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php index 0dad40cfa0a3f..1c1b47bb2be23 100644 --- a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php @@ -97,7 +97,7 @@ public function generateAbsoluteUrl($path) if (!$path || '/' !== $path[0]) { $prefix = $request->getPathInfo(); - $last = strlen($prefix) - 1; + $last = \strlen($prefix) - 1; if ($last !== $pos = strrpos($prefix, '/')) { $prefix = substr($prefix, 0, $pos).'/'; } diff --git a/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php b/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php index 97b1ea31360ce..f347239d0aca1 100644 --- a/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php @@ -100,7 +100,7 @@ public function isUrlGenerationSafe(\Twig_Node $argsNode) $argsNode->hasNode(1) ? $argsNode->getNode(1) : null ); - if (null === $paramsNode || $paramsNode instanceof ArrayExpression && count($paramsNode) <= 2 && + if (null === $paramsNode || $paramsNode instanceof ArrayExpression && \count($paramsNode) <= 2 && (!$paramsNode->hasNode(1) || $paramsNode->getNode(1) instanceof ConstantExpression) ) { return array('html'); diff --git a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php index 894a2fd189014..cb0f9e0fd33e7 100644 --- a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php @@ -42,8 +42,8 @@ public function encode($input, $inline = 0, $dumpObjects = false) $dumper = new YamlDumper(); } - if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) { - return $dumper->dump($input, $inline, 0, is_bool($dumpObjects) ? Yaml::DUMP_OBJECT : 0); + if (\defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) { + return $dumper->dump($input, $inline, 0, \is_bool($dumpObjects) ? Yaml::DUMP_OBJECT : 0); } return $dumper->dump($input, $inline, 0, false, $dumpObjects); @@ -51,12 +51,12 @@ public function encode($input, $inline = 0, $dumpObjects = false) public function dump($value, $inline = 0, $dumpObjects = false) { - if (is_resource($value)) { + if (\is_resource($value)) { return '%Resource%'; } - if (is_array($value) || is_object($value)) { - return '%'.gettype($value).'% '.$this->encode($value, $inline, $dumpObjects); + if (\is_array($value) || \is_object($value)) { + return '%'.\gettype($value).'% '.$this->encode($value, $inline, $dumpObjects); } return $this->encode($value, $inline, $dumpObjects); diff --git a/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php b/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php index d83124e721366..74b2e51b76ad4 100644 --- a/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php +++ b/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php @@ -100,7 +100,7 @@ protected function loadResourceForBlockName($cacheKey, FormView $view, $blockNam // Check each theme whether it contains the searched block if (isset($this->themes[$cacheKey])) { - for ($i = count($this->themes[$cacheKey]) - 1; $i >= 0; --$i) { + for ($i = \count($this->themes[$cacheKey]) - 1; $i >= 0; --$i) { $this->loadResourcesFromTheme($cacheKey, $this->themes[$cacheKey][$i]); // CONTINUE LOADING (see doc comment) } @@ -108,7 +108,7 @@ protected function loadResourceForBlockName($cacheKey, FormView $view, $blockNam // Check the default themes once we reach the root view without success if (!$view->parent) { - for ($i = count($this->defaultThemes) - 1; $i >= 0; --$i) { + for ($i = \count($this->defaultThemes) - 1; $i >= 0; --$i) { $this->loadResourcesFromTheme($cacheKey, $this->defaultThemes[$i]); // CONTINUE LOADING (see doc comment) } diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index 1a60e67a2f945..7b443ffe5fd2d 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -64,7 +64,7 @@ protected function doEnterNode(Node $node, Environment $env) return $node; } - if ($node instanceof FilterExpression && in_array($node->getNode('filter')->getAttribute('value'), array('trans', 'transchoice'))) { + if ($node instanceof FilterExpression && \in_array($node->getNode('filter')->getAttribute('value'), array('trans', 'transchoice'))) { $arguments = $node->getNode('arguments'); $ind = 'trans' === $node->getNode('filter')->getAttribute('value') ? 1 : 2; if ($this->isNamedArguments($arguments)) { @@ -119,7 +119,7 @@ public function getPriority() private function isNamedArguments($arguments) { foreach ($arguments as $name => $node) { - if (!is_int($name)) { + if (!\is_int($name)) { return true; } } diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php index 36e0e6a08d99e..3b6fbfbe3d76e 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php @@ -75,7 +75,7 @@ public function testDump($context, $args, $expectedOutput, $debug = true) array_unshift($args, $context); array_unshift($args, $twig); - $dump = call_user_func_array(array($extension, 'dump'), $args); + $dump = \call_user_func_array(array($extension, 'dump'), $args); if ($debug) { $this->assertStringStartsWith('