From 5558cfe774d7e0e7e8b060ee9177c6022558d87d Mon Sep 17 00:00:00 2001 From: SpacePossum Date: Wed, 27 Sep 2017 18:13:03 +0200 Subject: [PATCH] compiler opt --- .../Doctrine/ContainerAwareEventManager.php | 6 +- .../DataCollector/DoctrineDataCollector.php | 12 ++-- .../AbstractDoctrineExtension.php | 10 +-- ...gisterEventListenersAndSubscribersPass.php | 2 +- .../CompilerPass/RegisterMappingsPass.php | 4 +- .../Form/ChoiceList/DoctrineChoiceLoader.php | 4 +- .../Form/ChoiceList/EntityChoiceList.php | 6 +- .../Doctrine/Form/ChoiceList/IdReader.php | 4 +- .../Form/ChoiceList/ORMQueryBuilderLoader.php | 4 +- .../CollectionToArrayTransformer.php | 2 +- .../Doctrine/Form/DoctrineOrmTypeGuesser.php | 4 +- .../MergeDoctrineCollectionListener.php | 2 +- .../Doctrine/Form/Type/DoctrineType.php | 2 +- .../Bridge/Doctrine/Form/Type/EntityType.php | 2 +- .../Bridge/Doctrine/Logger/DbalLogger.php | 6 +- .../Security/User/EntityUserProvider.php | 4 +- .../DoctrineExtensionTest.php | 4 +- .../Form/Type/EntityTypePerformanceTest.php | 2 +- .../Doctrine/Tests/Logger/DbalLoggerTest.php | 2 +- .../Security/User/EntityUserProviderTest.php | 2 +- .../Constraints/UniqueEntityValidator.php | 18 +++--- .../Validator/DoctrineInitializer.php | 2 +- .../Bridge/Monolog/Handler/DebugHandler.php | 2 +- .../PhpUnit/DeprecationErrorHandler.php | 8 +-- .../Instantiator/RuntimeInstantiator.php | 2 +- src/Symfony/Bridge/Twig/AppVariable.php | 2 +- .../Bridge/Twig/Command/DebugCommand.php | 10 +-- .../Bridge/Twig/Command/LintCommand.php | 8 +-- .../Bridge/Twig/Extension/AssetExtension.php | 4 +- .../Bridge/Twig/Extension/CodeExtension.php | 8 +-- .../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 +- .../Command/AbstractConfigCommand.php | 2 +- .../Command/CacheClearCommand.php | 12 ++-- .../FrameworkBundle/Command/ServerCommand.php | 2 +- .../Command/TranslationDebugCommand.php | 6 +- .../Command/TranslationUpdateCommand.php | 4 +- .../Command/YamlLintCommand.php | 4 +- .../Console/Descriptor/Descriptor.php | 10 +-- .../Console/Descriptor/JsonDescriptor.php | 22 +++---- .../Console/Descriptor/MarkdownDescriptor.php | 28 ++++---- .../Console/Descriptor/TextDescriptor.php | 34 +++++----- .../Console/Descriptor/XmlDescriptor.php | 24 +++---- .../FrameworkBundle/Controller/Controller.php | 2 +- .../Controller/ControllerNameParser.php | 6 +- .../Controller/RedirectController.php | 2 +- .../DataCollector/RouterDataCollector.php | 2 +- .../Compiler/AddCacheWarmerPass.php | 2 +- .../Compiler/SerializerPass.php | 2 +- .../Compiler/TemplatingAssetHelperPass.php | 2 +- .../Compiler/TemplatingPass.php | 2 +- .../DependencyInjection/Configuration.php | 38 +++++------ .../FrameworkExtension.php | 10 +-- .../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 | 6 +- .../Templating/Helper/StopwatchHelper.php | 2 +- .../FrameworkBundle/Templating/PhpEngine.php | 2 +- .../Templating/TemplateFilenameParser.php | 2 +- .../FrameworkBundle/Test/KernelTestCase.php | 6 +- .../CacheClearCommandTest.php | 4 +- .../Controller/ControllerResolverTest.php | 2 +- .../FrameworkExtensionTest.php | 2 +- .../Controller/AnnotatedController.php | 2 +- .../Tests/Functional/WebTestCase.php | 2 +- .../Helper/FormHelperDivLayoutTest.php | 2 +- .../Helper/FormHelperTableLayoutTest.php | 2 +- .../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 +- .../Security/Factory/RememberMeFactory.php | 4 +- .../DependencyInjection/SecurityExtension.php | 6 +- .../CompleteConfigurationTest.php | 2 +- .../Tests/Functional/WebTestCase.php | 2 +- .../Compiler/ExceptionListenerPass.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 | 10 +-- src/Symfony/Component/BrowserKit/History.php | 8 +-- src/Symfony/Component/BrowserKit/Response.php | 6 +- .../Component/ClassLoader/ApcClassLoader.php | 2 +- .../ClassLoader/ClassCollectionLoader.php | 10 +-- .../Component/ClassLoader/ClassLoader.php | 4 +- .../ClassLoader/ClassMapGenerator.php | 8 +-- .../ClassLoader/DebugClassLoader.php | 4 +- .../ClassLoader/DebugUniversalClassLoader.php | 4 +- .../Component/ClassLoader/Psr4ClassLoader.php | 2 +- .../Tests/ClassCollectionLoaderTest.php | 2 +- .../ClassLoader/WinCacheClassLoader.php | 2 +- .../ClassLoader/XcacheClassLoader.php | 2 +- .../Component/Config/ConfigCacheFactory.php | 4 +- .../Component/Config/Definition/ArrayNode.php | 12 ++-- .../Config/Definition/BooleanNode.php | 4 +- .../Builder/ArrayNodeDefinition.php | 4 +- .../Definition/Builder/EnumNodeDefinition.php | 2 +- .../Config/Definition/Builder/ExprBuilder.php | 8 +-- .../Definition/Dumper/XmlReferenceDumper.php | 24 +++---- .../Definition/Dumper/YamlReferenceDumper.php | 26 ++++---- .../Component/Config/Definition/EnumNode.php | 4 +- .../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 +- .../Builder/ArrayNodeDefinitionTest.php | 4 +- .../Definition/Builder/NodeBuilderTest.php | 4 +- .../Config/Tests/Loader/LoaderTest.php | 2 +- .../Tests/Resource/DirectoryResourceTest.php | 2 +- .../Component/Config/Util/XmlUtils.php | 12 ++-- src/Symfony/Component/Console/Application.php | 44 ++++++------- .../Component/Console/Command/Command.php | 6 +- .../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 | 8 +-- .../Component/Console/Helper/HelperSet.php | 2 +- .../Console/Helper/ProcessHelper.php | 4 +- .../Component/Console/Helper/ProgressBar.php | 2 +- .../Console/Helper/ProgressHelper.php | 2 +- .../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 | 14 ++-- .../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 +- .../Component/Console/Output/StreamOutput.php | 2 +- .../Console/Question/ChoiceQuestion.php | 2 +- .../Console/Question/ConfirmationQuestion.php | 2 +- .../Component/Console/Question/Question.php | 6 +- .../Component/Console/Style/SymfonyStyle.php | 12 ++-- .../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 | 16 ++--- .../Debug/Exception/FlattenException.php | 20 +++--- .../Component/Debug/ExceptionHandler.php | 14 ++-- .../ClassNotFoundFatalErrorHandler.php | 14 ++-- .../UndefinedFunctionFatalErrorHandler.php | 6 +- .../UndefinedMethodFatalErrorHandler.php | 2 +- .../Debug/Tests/DebugClassLoaderTest.php | 6 +- .../Debug/Tests/ErrorHandlerTest.php | 4 +- .../ClassNotFoundFatalErrorHandlerTest.php | 2 +- .../Component/Debug/Tests/HeaderMock.php | 4 +- .../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 | 4 +- .../Compiler/ResolveInvalidReferencesPass.php | 2 +- .../ResolveParameterPlaceHoldersPass.php | 2 +- .../ResolveReferencesToAliasesPass.php | 4 +- .../DependencyInjection/Container.php | 8 +-- .../DependencyInjection/ContainerBuilder.php | 22 +++---- .../DependencyInjection/Definition.php | 12 ++-- .../DefinitionDecorator.php | 4 +- .../Dumper/GraphvizDumper.php | 6 +- .../DependencyInjection/Dumper/PhpDumper.php | 58 ++++++++--------- .../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/IniFileLoader.php | 4 +- .../Loader/PhpFileLoader.php | 2 +- .../Loader/XmlFileLoader.php | 10 +-- .../Loader/YamlFileLoader.php | 42 ++++++------ .../ParameterBag/ParameterBag.php | 18 +++--- .../Tests/ContainerBuilderTest.php | 4 +- .../Tests/Loader/XmlFileLoaderTest.php | 4 +- src/Symfony/Component/DomCrawler/Crawler.php | 36 +++++------ .../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 +- .../DomCrawler/Tests/CrawlerTest.php | 2 +- .../Component/DomCrawler/Tests/FormTest.php | 2 +- .../ContainerAwareEventDispatcher.php | 6 +- .../Debug/TraceableEventDispatcher.php | 10 +-- .../EventDispatcher/Debug/WrappedListener.php | 2 +- .../EventDispatcher/EventDispatcher.php | 12 ++-- .../Component/ExpressionLanguage/Compiler.php | 6 +- .../ExpressionLanguage/ExpressionLanguage.php | 2 +- .../Component/ExpressionLanguage/Lexer.php | 10 +-- .../ExpressionLanguage/Node/BinaryNode.php | 6 +- .../ExpressionLanguage/Node/FunctionNode.php | 4 +- .../ExpressionLanguage/Node/GetAttrNode.php | 10 +-- .../ExpressionLanguage/Node/Node.php | 4 +- .../Component/ExpressionLanguage/Parser.php | 4 +- .../ExpressionLanguage/Tests/LexerTest.php | 2 +- .../Component/Filesystem/Filesystem.php | 30 ++++----- .../Filesystem/Tests/FilesystemTest.php | 4 +- .../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 | 2 +- .../Finder/Iterator/FilePathsIterator.php | 4 +- .../Component/Finder/Shell/Command.php | 4 +- src/Symfony/Component/Finder/Shell/Shell.php | 2 +- .../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 | 10 +-- .../Component/Form/AbstractExtension.php | 2 +- .../Component/Form/AbstractRendererEngine.php | 2 +- src/Symfony/Component/Form/AbstractType.php | 2 +- .../Component/Form/AbstractTypeExtension.php | 2 +- .../Component/Form/CallbackTransformer.php | 4 +- .../Form/ChoiceList/ArrayChoiceList.php | 8 +-- .../Form/ChoiceList/ArrayKeyChoiceList.php | 8 +-- .../Factory/CachingFactoryDecorator.php | 8 +-- .../Factory/DefaultChoiceListFactory.php | 22 +++---- .../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/MergeCollectionListener.php | 6 +- .../Core/EventListener/ResizeFormListener.php | 6 +- .../Core/EventListener/TrimListener.php | 2 +- .../Form/Extension/Core/Type/ChoiceType.php | 18 +++--- .../Form/Extension/Core/Type/DateTimeType.php | 6 +- .../Form/Extension/Core/Type/DateType.php | 10 +-- .../Form/Extension/Core/Type/FileType.php | 2 +- .../Form/Extension/Core/Type/FormType.php | 2 +- .../Form/Extension/Core/Type/TimeType.php | 2 +- .../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 | 2 +- .../EventListener/BindRequestListener.php | 2 +- .../HttpFoundationRequestHandler.php | 6 +- .../Templating/TemplatingRendererEngine.php | 4 +- .../Validator/Constraints/FormValidator.php | 18 +++--- .../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 | 2 +- .../Component/Form/FormFactoryBuilder.php | 4 +- src/Symfony/Component/Form/FormRenderer.php | 4 +- src/Symfony/Component/Form/FormView.php | 4 +- .../Component/Form/NativeRequestHandler.php | 12 ++-- .../Component/Form/ResolvedFormType.php | 10 +-- .../Form/Test/FormPerformanceTestCase.php | 2 +- .../Tests/AbstractBootstrap3LayoutTest.php | 8 +-- .../Form/Tests/AbstractLayoutTest.php | 10 +-- .../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 +- .../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/BinaryFileResponse.php | 8 +-- .../Exception/UnexpectedTypeException.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 | 10 +-- .../Component/HttpFoundation/Request.php | 46 ++++++------- .../HttpFoundation/RequestMatcher.php | 6 +- .../Component/HttpFoundation/RequestStack.php | 2 +- .../Component/HttpFoundation/Response.php | 16 ++--- .../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 | 2 +- .../HttpFoundation/StreamedResponse.php | 2 +- .../HttpFoundation/Tests/HeaderBagTest.php | 4 +- .../HttpFoundation/Tests/IpUtilsTest.php | 4 +- .../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 +- .../Storage/Handler/PdoSessionHandlerTest.php | 6 +- .../Component/HttpKernel/Bundle/Bundle.php | 4 +- src/Symfony/Component/HttpKernel/Client.php | 2 +- .../Controller/ControllerResolver.php | 20 +++--- .../DataCollector/DumpDataCollector.php | 6 +- .../DataCollector/LoggerDataCollector.php | 10 +-- .../DataCollector/MemoryDataCollector.php | 4 +- .../DataCollector/RequestDataCollector.php | 12 ++-- .../DataCollector/Util/ValueExporter.php | 12 ++-- .../MergeExtensionConfigurationPass.php | 2 +- .../Event/FilterControllerEvent.php | 8 +-- .../EventListener/DebugHandlersListener.php | 10 +-- .../EventListener/ExceptionListener.php | 4 +- .../AbstractSurrogateFragmentRenderer.php | 2 +- .../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 | 4 +- .../Component/HttpKernel/HttpKernel.php | 10 +-- src/Symfony/Component/HttpKernel/Kernel.php | 10 +-- .../Profiler/BaseMemcacheProfilerStorage.php | 2 +- .../Profiler/FileProfilerStorage.php | 2 +- .../Profiler/MysqlProfilerStorage.php | 2 +- .../Profiler/PdoProfilerStorage.php | 4 +- .../HttpKernel/Profiler/Profiler.php | 2 +- .../Profiler/RedisProfilerStorage.php | 2 +- .../Profiler/SqliteProfilerStorage.php | 8 +-- .../DataCollector/DumpDataCollectorTest.php | 2 +- .../EventListener/ExceptionListenerTest.php | 6 +- .../Tests/Fragment/FragmentHandlerTest.php | 2 +- .../HttpKernel/Tests/HttpCache/EsiTest.php | 4 +- .../Tests/HttpCache/HttpCacheTest.php | 8 +-- .../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/Writer/TextBundleWriter.php | 12 ++-- .../Data/Generator/LanguageDataGenerator.php | 6 +- .../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 | 4 +- .../Exception/UnexpectedTypeException.php | 2 +- src/Symfony/Component/Intl/Intl.php | 2 +- src/Symfony/Component/Intl/Locale.php | 2 +- .../Intl/NumberFormatter/NumberFormatter.php | 12 ++-- .../Bundle/Reader/BundleEntryReaderTest.php | 12 ++-- .../Bundle/Reader/IntlBundleReaderTest.php | 4 +- .../AbstractIntlDateFormatterTest.php | 4 +- .../Intl/Tests/Locale/LocaleTest.php | 4 +- .../Tests/Locale/Verification/LocaleTest.php | 4 +- .../Component/Intl/Util/IcuVersion.php | 2 +- .../Component/Intl/Util/IntlTestHelper.php | 2 +- .../Locale/Tests/Stub/StubLocaleTest.php | 2 +- .../OptionsResolver/OptionsResolver.php | 36 +++++------ .../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 | 12 ++-- .../Component/Process/ProcessBuilder.php | 4 +- .../Component/Process/ProcessUtils.php | 8 +-- .../Process/Tests/ExecutableFinderTest.php | 4 +- .../Process/Tests/PhpExecutableFinderTest.php | 8 +-- .../Component/Process/Tests/ProcessTest.php | 12 ++-- .../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 +- .../Component/Routing/Annotation/Route.php | 10 +-- .../Routing/Generator/UrlGenerator.php | 4 +- .../Routing/Loader/AnnotationClassLoader.php | 2 +- .../Loader/AnnotationDirectoryLoader.php | 4 +- .../Routing/Loader/AnnotationFileLoader.php | 6 +- .../Routing/Loader/PhpFileLoader.php | 2 +- .../Routing/Loader/XmlFileLoader.php | 6 +- .../Routing/Loader/YamlFileLoader.php | 10 +-- .../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 +- .../Security/Acl/Dbal/AclProvider.php | 16 ++--- .../Security/Acl/Dbal/MutableAclProvider.php | 30 ++++----- .../Component/Security/Acl/Domain/Acl.php | 34 +++++----- .../Security/Acl/Domain/DoctrineAclCache.php | 2 +- .../Security/Acl/Domain/ObjectIdentity.php | 2 +- .../Acl/Domain/UserSecurityIdentity.php | 2 +- .../Acl/Permission/AbstractMaskBuilder.php | 2 +- .../Security/Acl/Permission/MaskBuilder.php | 14 ++-- .../Tests/Dbal/AclProviderBenchmarkTest.php | 8 +-- .../Acl/Tests/Dbal/MutableAclProviderTest.php | 6 +- .../Security/Acl/Tests/Domain/AclTest.php | 2 +- .../ObjectIdentityRetrievalStrategyTest.php | 2 +- .../SecurityIdentityRetrievalStrategyTest.php | 2 +- .../Component/Security/Acl/Voter/AclVoter.php | 2 +- .../AuthenticationProviderManager.php | 4 +- .../Authentication/Token/AbstractToken.php | 10 +-- .../Token/UsernamePasswordToken.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 | 4 +- .../Encoder/BCryptPasswordEncoderTest.php | 2 +- .../Security/Core/User/ChainUserProvider.php | 2 +- .../Core/User/InMemoryUserProvider.php | 2 +- .../Security/Core/Util/ClassUtils.php | 2 +- .../Security/Core/Util/StringUtils.php | 8 +-- .../SimpleAuthenticationHandler.php | 8 +-- .../Http/Firewall/ContextListener.php | 8 +-- .../Firewall/DigestAuthenticationListener.php | 2 +- .../SimpleFormAuthenticationListener.php | 2 +- .../SimplePreAuthenticationListener.php | 8 +-- ...namePasswordFormAuthenticationListener.php | 2 +- .../RememberMe/AbstractRememberMeServices.php | 2 +- ...PersistentTokenBasedRememberMeServices.php | 6 +- .../TokenBasedRememberMeServices.php | 6 +- .../AbstractRememberMeServicesTest.php | 2 +- .../Serializer/Annotation/Groups.php | 10 +-- .../Serializer/Encoder/XmlEncoder.php | 28 ++++---- .../Serializer/Mapping/AttributeMetadata.php | 2 +- .../Mapping/Factory/ClassMetadataFactory.php | 6 +- .../Serializer/Mapping/Loader/LoaderChain.php | 2 +- .../Mapping/Loader/YamlFileLoader.php | 8 +-- .../CamelCaseToSnakeCaseNameConverter.php | 6 +- .../Normalizer/AbstractNormalizer.php | 16 ++--- .../Normalizer/GetSetMethodNormalizer.php | 16 ++--- .../Normalizer/ObjectNormalizer.php | 10 +-- .../Normalizer/PropertyNormalizer.php | 12 ++-- .../Component/Serializer/Serializer.php | 6 +- .../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/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/MoFileLoader.php | 4 +- .../Translation/Loader/PoFileLoader.php | 10 +-- .../Translation/Loader/YamlFileLoader.php | 2 +- .../Translation/LoggingTranslator.php | 4 +- .../Component/Translation/MessageSelector.php | 2 +- .../Translation/PluralizationRules.php | 12 ++-- .../Tests/PluralizationRulesTest.php | 4 +- .../Translation/Tests/TranslatorTest.php | 2 +- .../Component/Translation/Translator.php | 6 +- .../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/Callback.php | 6 +- .../Constraints/CallbackValidator.php | 12 ++-- .../Validator/Constraints/ChoiceValidator.php | 12 ++-- .../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 | 6 +- .../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/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/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 +- .../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/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 +- .../Component/VarDumper/Caster/CutStub.php | 8 +-- .../VarDumper/Caster/ExceptionCaster.php | 2 +- .../Component/VarDumper/Caster/StubCaster.php | 2 +- .../VarDumper/Cloner/AbstractCloner.php | 6 +- .../Component/VarDumper/Cloner/Data.php | 10 +-- .../Component/VarDumper/Cloner/VarCloner.php | 20 +++--- .../VarDumper/Dumper/AbstractDumper.php | 10 +-- .../Component/VarDumper/Dumper/CliDumper.php | 16 ++--- .../Component/VarDumper/Dumper/HtmlDumper.php | 4 +- .../Exception/ThrowingCasterException.php | 2 +- .../VarDumper/Tests/CliDumperTest.php | 8 +-- .../VarDumper/Tests/HtmlDumperTest.php | 2 +- src/Symfony/Component/VarDumper/VarDumper.php | 2 +- 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 +-- 656 files changed, 2061 insertions(+), 2061 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php index 0888f97ca91d8..626a1313af894 100644 --- a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php +++ b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php @@ -56,7 +56,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); } @@ -100,7 +100,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.'); } @@ -126,7 +126,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 c0623572ec606..d4ef3b828ba72 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -162,7 +162,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(); @@ -249,7 +249,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 '. @@ -278,11 +278,11 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container) $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/RegisterEventListenersAndSubscribersPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php index cb4a4816db70a..c4f6d12839ea4 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -156,7 +156,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 7f169fe1ae696..2be3c7cc2b7ed 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -126,7 +126,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; @@ -153,7 +153,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 02280c4fe8785..3d697f03238c4 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -110,7 +110,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()) { @@ -147,7 +147,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 72d7a6f10bd4f..a31f9523a42cf 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, @@ -453,13 +453,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 0161adf3b4c0a..004b00d0554f2 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php @@ -61,8 +61,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 diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php index 8d73c32d9e04b..e7827929de481 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 e56674be351c5..4d369504d5130 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php +++ b/src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php @@ -38,7 +38,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 ebdcb02ca77a4..939d6a13e74fb 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 && $ret[0]->hasField($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 17036a591322a..299c494b782c3 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -260,7 +260,7 @@ public function configureOptions(OptionsResolver $resolver) // for equal query builders $queryBuilderNormalizer = function (Options $options, $queryBuilder) { if (is_callable($queryBuilder)) { - $queryBuilder = call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); + $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 fef097d3ea60d..4bb3cdab66c8a 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php @@ -29,7 +29,7 @@ public function configureOptions(OptionsResolver $resolver) // for equal query builders $queryBuilderNormalizer = function (Options $options, $queryBuilder) { if (is_callable($queryBuilder)) { - $queryBuilder = call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); + $queryBuilder = \call_user_func($queryBuilder, $options['em']->getRepository($options['class'])); if (!$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 acd8cc0fcd510..65a973646e129 100644 --- a/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php +++ b/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php @@ -79,12 +79,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; } @@ -101,7 +101,7 @@ private function normalizeParams(array $params) continue; } } else { - if (self::MAX_STRING_LENGTH < strlen($params[$index])) { + if (self::MAX_STRING_LENGTH < \strlen($params[$index])) { $params[$index] = substr($params[$index], 0, self::MAX_STRING_LENGTH - 6).' [...]'; continue; } diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 058eb7167e961..773823948b5eb 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -51,7 +51,7 @@ public function loadUserByUsername($username) $user = $repository->findOneBy(array($this->property => $username)); } else { if (!$repository instanceof UserProviderInterface) { - throw new \InvalidArgumentException(sprintf('You must either make the "%s" entity Doctrine Repository ("%s") implement "Symfony\Component\Security\Core\User\UserProviderInterface" 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\Component\Security\Core\User\UserProviderInterface" or set the "property" option in the corresponding entity provider configuration.', $this->classOrAlias, \get_class($repository))); } $user = $repository->loadUserByUsername($username); @@ -71,7 +71,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/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index 860162a77d5d2..c8f35aa31de79 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 f72d7d09d0f95..a318030841c29 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 5a627dc23155b..559ad1cdcb34d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -148,7 +148,7 @@ public function testLogUTF8LongString() ; $testStringArray = array('é', 'á', 'ű', 'ő', 'ú', 'ö', 'ü', 'ó', 'í'); - $testStringCount = count($testStringArray); + $testStringCount = \count($testStringArray); $shortString = ''; $longString = ''; diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index ac7dc543a1d8a..7bf1e61b1c001 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -146,7 +146,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))); } private function getManager($em, $name = null) diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index b0d9534a0e98d..4ad04d6cab2b5 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -48,17 +48,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.'); } @@ -73,14 +73,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(); @@ -123,7 +123,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) { @@ -136,7 +136,7 @@ public function validate($entity, Constraint $constraint) */ if ($result instanceof \Iterator) { $result->rewind(); - } elseif (is_array($result)) { + } elseif (\is_array($result)) { reset($result); } @@ -144,7 +144,7 @@ public function validate($entity, Constraint $constraint) * which is the same as the entity being validated, the criteria is * unique. */ - if (0 === count($result) || (1 === count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result)))) { + if (0 === \count($result) || (1 === \count($result) && $entity === ($result instanceof \Iterator ? $result->current() : current($result)))) { return; } 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 c959a5a94fcb7..a49c19d14303c 100644 --- a/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/DebugHandler.php @@ -50,7 +50,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/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 66b8762cff4e9..524d16633af73 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -58,13 +58,13 @@ public static function register($mode = false) $trace = debug_backtrace(true); $group = 'other'; - $i = count($trace); + $i = \count($trace); while (1 < $i && (!isset($trace[--$i]['class']) || ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_')))) { // No-op } if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) { - $class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class']; + $class = isset($trace[$i]['object']) ? \get_class($trace[$i]['object']) : $trace[$i]['class']; $method = $trace[$i]['function']; if (0 !== error_reporting()) { @@ -73,7 +73,7 @@ public static function register($mode = false) || 0 === strpos($method, 'provideLegacy') || 0 === strpos($method, 'getLegacy') || strpos($class, '\Legacy') - || in_array('legacy', \PHPUnit_Util_Test::getGroups($class, $method), true) + || \in_array('legacy', \PHPUnit_Util_Test::getGroups($class, $method), true) ) { $group = 'legacy'; } else { @@ -167,6 +167,6 @@ private static function hasColorSupport() || 'xterm' === getenv('TERM'); } - return defined('STDOUT') && function_exists('posix_isatty') && @posix_isatty(STDOUT); + return \defined('STDOUT') && function_exists('posix_isatty') && @posix_isatty(STDOUT); } } 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/Twig/AppVariable.php b/src/Symfony/Bridge/Twig/AppVariable.php index 88d9835ce2399..b90f64db2cf1a 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 f86013b0e2476..8a4c7862ad50c 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -140,16 +140,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)) { $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'); @@ -199,8 +199,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 a731242ce5403..69e3fd2d1fa2e 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -98,7 +98,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.'); } @@ -182,7 +182,7 @@ private function displayTxt(OutputInterface $output, $filesInfo) } } - $output->writeln(sprintf('%d/%d valid files', count($filesInfo) - $errors, count($filesInfo))); + $output->writeln(sprintf('%d/%d valid files', \count($filesInfo) - $errors, \count($filesInfo))); return min($errors, 1); } @@ -201,7 +201,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); } @@ -234,7 +234,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 eca1e52d77a70..0e55dc1a5208a 100644 --- a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php @@ -94,7 +94,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]) { @@ -107,7 +107,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); @@ -144,7 +144,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]).''; } @@ -168,7 +168,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 053b1d4a6b336..f9c1f12d5445b 100644 --- a/src/Symfony/Bridge/Twig/Extension/FormExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/FormExtension.php @@ -149,8 +149,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 b3c89d18eb2bd..9fed49b687d9b 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -72,7 +72,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)) { @@ -127,7 +127,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('