From 8892b98627c5f584ded7dbaa5d87fb691e0a95ff Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 5 Jul 2018 12:52:40 +0200 Subject: [PATCH 1/5] 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 2731440d19..f83990d859 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 2/5] 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 f83990d859..2fcc078ebb 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 3/5] 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 bbd7ddfeb2..1ea0e127f7 100644 --- a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -35,22 +35,22 @@ while ($read || $write) { } 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 4/5] 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 2fcc078ebb..7138413855 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 895ade5fe7..baa99fac5d 100644 --- a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php +++ b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php @@ -54,7 +54,7 @@ class ContainerAwareEventManager extends EventManager $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 @@ class ContainerAwareEventManager extends EventManager */ 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 @@ class ContainerAwareEventManager extends EventManager */ 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 a57b9ae6ea..2580c1b88d 100644 --- a/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php +++ b/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php @@ -120,14 +120,14 @@ class DoctrineDataCollector extends DataCollector 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 @@ class DoctrineDataCollector extends DataCollector */ 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 @@ class DoctrineDataCollector extends DataCollector 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 8426d307da..ac79c576af 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -142,7 +142,7 @@ abstract class AbstractDoctrineExtension extends Extension */ 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 @@ abstract class AbstractDoctrineExtension extends Extension } 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 @@ abstract class AbstractDoctrineExtension extends Extension 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 @@ abstract class AbstractDoctrineExtension extends Extension $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 82c1b7c811..4b030955a9 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php @@ -60,7 +60,7 @@ class DoctrineValidationPass implements CompilerPassInterface 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 f7d513a14e..2ba7747e38 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -153,7 +153,7 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface 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 6ec2407d90..ac3a55e481 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -124,7 +124,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface $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 @@ abstract class RegisterMappingsPass implements CompilerPassInterface $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 bf5890c1e6..43120c6258 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -88,7 +88,7 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface // 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 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface // 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 2c226f50a0..b196e89183 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -117,7 +117,7 @@ class EntityChoiceList extends ObjectChoiceList $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 @@ class EntityChoiceList extends ObjectChoiceList $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 1d88184926..9c63233035 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php @@ -42,8 +42,8 @@ class IdReader $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 @@ class IdReader } 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 c9a02fb38d..0a0de20c57 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php @@ -98,7 +98,7 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface // 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 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface $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 307361a52a..63c8f2439b 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php +++ b/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php @@ -36,7 +36,7 @@ class CollectionToArrayTransformer implements DataTransformerInterface // 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 645e2fda4c..a1b614944e 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -131,7 +131,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface 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 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface { $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 bb4cfa5087..8f96f3677c 100644 --- a/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php +++ b/src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php @@ -41,7 +41,7 @@ class MergeDoctrineCollectionListener implements EventSubscriberInterface // 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 2acf7176f1..f76872a581 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -259,8 +259,8 @@ abstract class DoctrineType extends AbstractType // 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 7ec1ea3d43..99ce535e23 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php @@ -28,8 +28,8 @@ class EntityType extends DoctrineType // 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 42574edcad..9099fe0676 100644 --- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php +++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php @@ -71,12 +71,12 @@ class DbalLogger implements SQLLogger { 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 7356ff2998..18d3e690a7 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -52,7 +52,7 @@ class EntityUserProvider implements UserProviderInterface } 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 @@ class EntityUserProvider implements UserProviderInterface { $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 1a97922b05..9fa7c777a5 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 0a9dae3b20..63109fab99 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -68,7 +68,7 @@ class DoctrineExtensionTest extends TestCase '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 @@ class DoctrineExtensionTest extends TestCase '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 ac96ea21c5..048747c937 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 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase $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 1e3e6ca6ec..38bbed1294 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -145,7 +145,7 @@ class DbalLoggerTest extends TestCase ; $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 394eaebdef..8d0a938114 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 @@ class DoctrineFooType extends Type 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 @@ class DoctrineFooType extends Type 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 299138cf79..7779acaa80 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 @@ class EntityUserProviderTest extends TestCase $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 f000cae75e..cb08796131 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -45,17 +45,17 @@ class UniqueEntityValidator extends ConstraintValidator 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 @@ class UniqueEntityValidator extends ConstraintValidator 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 @@ class UniqueEntityValidator extends ConstraintValidator 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 42cafdd129..010c051581 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php +++ b/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php @@ -30,7 +30,7 @@ class DoctrineInitializer implements ObjectInitializerInterface 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 f1046c96a6..4c124709ea 100644 --- a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php @@ -51,7 +51,7 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface $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 8bfb9a6211..5cd3531d6b 100644 --- a/src/Symfony/Bridge/PhpUnit/ClockMock.php +++ b/src/Symfony/Bridge/PhpUnit/ClockMock.php @@ -71,7 +71,7 @@ class ClockMock 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 @@ class ClockMock $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 @@ class DeprecationErrorHandler // 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 @@ class DeprecationErrorHandler */ private static function hasColorSupport() { - if (!defined('STDOUT')) { + if (!\defined('STDOUT')) { return false; } @@ -231,18 +231,18 @@ class DeprecationErrorHandler } 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 7f218af9a3..82d6ab32e0 100644 --- a/src/Symfony/Bridge/PhpUnit/TextUI/Command.php +++ b/src/Symfony/Bridge/PhpUnit/TextUI/Command.php @@ -38,7 +38,7 @@ class Command extends \PHPUnit_TextUI_Command // 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 33fc49e101..7d083a6981 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php @@ -51,7 +51,7 @@ class RuntimeInstantiator implements InstantiatorInterface 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 e749ad40e0..662c274f78 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -57,7 +57,7 @@ class ProxyDumper implements DumperInterface 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 dbbee30a47..cdad4b8ee0 100644 --- a/src/Symfony/Bridge/Twig/AppVariable.php +++ b/src/Symfony/Bridge/Twig/AppVariable.php @@ -103,7 +103,7 @@ class AppVariable } $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 b7ba43fa3d..a9c50db50a 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -139,16 +139,16 @@ EOF 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 @@ EOF } 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 2c312c58e5..3a0fffca6f 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -99,7 +99,7 @@ EOF $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 @@ EOF } 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 @@ EOF } }); - $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 @@ EOF $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 40974686ad..271d71ad2b 100644 --- a/src/Symfony/Bridge/Twig/Extension/AssetExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/AssetExtension.php @@ -62,13 +62,13 @@ class AssetExtension extends AbstractExtension 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 e6fc9298fa..865befd3ba 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 @@ class CodeExtension extends AbstractExtension $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 @@ class CodeExtension extends AbstractExtension $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 @@ class CodeExtension extends AbstractExtension $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 @@ class CodeExtension extends AbstractExtension 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 eddd4d7f2a..70be3e9127 100644 --- a/src/Symfony/Bridge/Twig/Extension/DumpExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/DumpExtension.php @@ -56,7 +56,7 @@ class DumpExtension extends AbstractExtension 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 @@ class DumpExtension extends AbstractExtension $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 ab7c6ab626..552b39c2b9 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -152,8 +152,8 @@ class FormExtension extends AbstractExtension implements InitRuntimeInterface */ 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 0dad40cfa0..1c1b47bb2b 100644 --- a/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php @@ -97,7 +97,7 @@ class HttpFoundationExtension extends AbstractExtension 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 97b1ea3136..f347239d0a 100644 --- a/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/RoutingExtension.php @@ -100,7 +100,7 @@ class RoutingExtension extends AbstractExtension $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 894a2fd189..cb0f9e0fd3 100644 --- a/src/Symfony/Bridge/Twig/Extension/YamlExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/YamlExtension.php @@ -42,8 +42,8 @@ class YamlExtension extends AbstractExtension $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 @@ class YamlExtension extends AbstractExtension 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 d83124e721..74b2e51b76 100644 --- a/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php +++ b/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php @@ -100,7 +100,7 @@ class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererE // 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 @@ class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererE // 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 1a60e67a2f..7b443ffe5f 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -64,7 +64,7 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor 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 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor 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 36e0e6a08d..3b6fbfbe3d 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php @@ -75,7 +75,7 @@ class DumpExtensionTest extends TestCase 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('