From eafa3a2aa0b8f2e67eefa621500bb58c031ce177 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Wed, 15 Jul 2015 12:03:49 +0100 Subject: [PATCH] Issue #2533360 by hussainweb: Upgrade to Symfony 2.7.2 --- core/composer.lock | 152 +++++++-------- core/vendor/composer/installed.json | 184 +++++++++--------- core/vendor/symfony/browser-kit/Cookie.php | 3 +- .../Tests/ClassMapGeneratorTest.php | 2 +- .../LegacyApcUniversalClassLoaderTest.php | 2 - .../Tests/LegacyUniversalClassLoaderTest.php | 5 - core/vendor/symfony/console/Application.php | 2 +- .../console/Descriptor/TextDescriptor.php | 9 +- .../console/Formatter/OutputFormatter.php | 4 +- .../Formatter/OutputFormatterStyle.php | 2 + .../console/Helper/DebugFormatterHelper.php | 2 +- .../symfony/console/Helper/DialogHelper.php | 10 +- .../symfony/console/Helper/ProgressBar.php | 6 +- core/vendor/symfony/console/Helper/Table.php | 2 +- .../symfony/console/Input/ArgvInput.php | 2 +- .../symfony/console/Output/ConsoleOutput.php | 39 +++- .../console/Question/ChoiceQuestion.php | 3 +- core/vendor/symfony/console/Shell.php | 2 +- .../symfony/console/Tests/ApplicationTest.php | 6 +- .../console/Tests/Command/CommandTest.php | 4 - .../Tests/Descriptor/ObjectsProvider.php | 1 + .../Tests/Fixtures/input_option_6.json | 1 + .../console/Tests/Fixtures/input_option_6.md | 9 + .../console/Tests/Fixtures/input_option_6.txt | 1 + .../console/Tests/Fixtures/input_option_6.xml | 5 + .../Formatter/OutputFormatterStyleTest.php | 6 + .../Tests/Helper/LegacyDialogHelperTest.php | 5 - .../Tests/Helper/LegacyProgressHelperTest.php | 5 - .../Tests/Helper/LegacyTableHelperTest.php | 1 - .../Tests/Helper/ProcessHelperTest.php | 5 +- .../console/Tests/Helper/ProgressBarTest.php | 42 ++-- .../console/Tests/Helper/TableTest.php | 10 +- .../Tests/Input/InputDefinitionTest.php | 8 +- .../console/Tests/Input/StringInputTest.php | 2 - .../vendor/symfony/debug/DebugClassLoader.php | 4 +- core/vendor/symfony/debug/ErrorHandler.php | 73 ++++--- .../debug/Exception/FatalErrorException.php | 14 +- ...eException.php => FatalThrowableError.php} | 10 +- .../debug/Tests/DebugClassLoaderTest.php | 23 ++- .../symfony/debug/Tests/ErrorHandlerTest.php | 86 +++++++- .../ClassNotFoundFatalErrorHandlerTest.php | 6 +- ...UndefinedFunctionFatalErrorHandlerTest.php | 2 +- .../UndefinedMethodFatalErrorHandlerTest.php | 2 +- .../ResolveDefinitionTemplatesPass.php | 8 + .../Compiler/ResolveInvalidReferencesPass.php | 4 +- .../ResolveParameterPlaceHoldersPass.php | 2 +- .../DefinitionDecorator.php | 10 + .../Dumper/GraphvizDumper.php | 2 +- .../dependency-injection/Dumper/PhpDumper.php | 22 ++- .../Loader/XmlFileLoader.php | 4 +- .../Loader/YamlFileLoader.php | 8 +- .../ParameterBag/FrozenParameterBag.php | 10 + .../CheckDefinitionValidityPassTest.php | 2 - ...cyResolveParameterPlaceHoldersPassTest.php | 2 - .../ResolveDefinitionTemplatesPassTest.php | 34 ++++ .../Tests/ContainerBuilderTest.php | 8 - .../Tests/DefinitionDecoratorTest.php | 2 - .../Tests/DefinitionTest.php | 2 - .../Tests/Dumper/GraphvizDumperTest.php | 2 - .../Tests/Dumper/PhpDumperTest.php | 2 - .../Tests/Dumper/XmlDumperTest.php | 2 - .../Tests/Dumper/YamlDumperTest.php | 2 - .../Tests/Fixtures/includes/createphar.php | 2 +- .../Tests/LegacyContainerBuilderTest.php | 5 - .../Tests/LegacyDefinitionTest.php | 5 - .../Tests/Loader/XmlFileLoaderTest.php | 2 - .../Tests/Loader/YamlFileLoaderTest.php | 2 - .../symfony/dom-crawler/Tests/FormTest.php | 1 - .../Tests/AbstractEventDispatcherTest.php | 4 - .../event-dispatcher/Tests/EventTest.php | 4 - .../File/MimeType/MimeTypeGuesser.php | 8 + .../symfony/http-foundation/JsonResponse.php | 72 ++++--- .../symfony/http-foundation/Request.php | 8 +- .../symfony/http-foundation/Response.php | 10 +- .../Storage/Handler/PdoSessionHandler.php | 6 +- .../Storage/MockArraySessionStorage.php | 2 +- .../Session/Storage/NativeSessionStorage.php | 8 +- .../http-foundation/Tests/ClockMock.php | 24 +++ .../http-foundation/Tests/CookieTest.php | 2 + .../http-foundation/Tests/File/FileTest.php | 13 ++ .../Tests/File/Fixtures/other-file.example | 0 .../Tests/JsonResponseTest.php | 9 +- .../http-foundation/Tests/RequestTest.php | 1 - .../Tests/ResponseHeaderBagTest.php | 6 +- .../Tests/Session/Flash/FlashBagTest.php | 2 - .../Handler/LegacyPdoSessionHandlerTest.php | 2 - .../Storage/NativeSessionStorageTest.php | 12 +- .../Storage/PhpBridgeSessionStorageTest.php | 1 - .../DataCollector/RequestDataCollector.php | 2 +- .../symfony/http-kernel/HttpCache/Esi.php | 2 +- core/vendor/symfony/http-kernel/Kernel.php | 6 +- .../ContainerAwareHttpKernelTest.php | 8 +- .../FragmentRendererPassTest.php | 2 - .../EventListener/FragmentListenerTest.php | 1 - .../EventListener/ProfilerListenerTest.php | 2 - .../symfony/http-kernel/Tests/KernelTest.php | 2 - .../symfony/http-kernel/Tests/Logger.php | 8 +- .../symfony/process/PhpExecutableFinder.php | 2 +- core/vendor/symfony/process/ProcessUtils.php | 2 +- .../process/Tests/AbstractProcessTest.php | 127 ++++++------ .../process/Tests/ExecutableFinderTest.php | 4 +- .../process/Tests/PhpExecutableFinderTest.php | 6 +- .../PipeStdinInStdoutStdErrStreamSelect.php | 4 +- .../process/Tests/SimpleProcessTest.php | 6 +- .../symfony/routing/Annotation/Route.php | 2 +- .../Matcher/Dumper/PhpMatcherDumper.php | 6 +- .../routing/Tests/Annotation/RouteTest.php | 2 - .../Dumper/PhpGeneratorDumperTest.php | 2 +- .../Tests/Generator/UrlGeneratorTest.php | 2 - .../Tests/Loader/XmlFileLoaderTest.php | 2 - .../Tests/Loader/YamlFileLoaderTest.php | 2 - .../Dumper/LegacyApacheMatcherDumperTest.php | 5 - .../Matcher/LegacyApacheUrlMatcherTest.php | 1 - .../symfony/routing/Tests/RouteTest.php | 6 - .../symfony/serializer/Annotation/Groups.php | 11 +- .../serializer/Mapping/ClassMetadata.php | 2 +- .../Normalizer/AbstractNormalizer.php | 2 +- .../Tests/Annotation/GroupsTest.php | 6 +- .../Tests/Mapping/AttributeMetadataTest.php | 10 + .../Tests/Mapping/ClassMetadataTest.php | 17 ++ .../Normalizer/GetSetMethodNormalizerTest.php | 6 - .../Tests/Normalizer/ObjectNormalizerTest.php | 2 - .../Normalizer/PropertyNormalizerTest.php | 6 - .../translation/Loader/JsonFileLoader.php | 2 +- .../translation/PluralizationRules.php | 2 +- .../translation/Tests/TranslatorTest.php | 2 +- .../Constraints/CallbackValidator.php | 2 +- .../Constraints/CardSchemeValidator.php | 10 +- .../validator/Constraints/EmailValidator.php | 4 +- .../symfony/validator/Constraints/File.php | 66 +++++-- .../Resources/translations/validators.it.xlf | 2 +- .../AbstractConstraintValidatorTest.php | 4 - .../Constraints/CallbackValidatorTest.php | 14 -- .../Constraints/CardSchemeValidatorTest.php | 2 + .../Tests/Constraints/EmailValidatorTest.php | 1 + .../validator/Tests/Constraints/FileTest.php | 53 ++++- .../Tests/Constraints/GroupSequenceTest.php | 10 - .../Tests/LegacyExecutionContextTest.php | 2 - .../Mapping/Cache/LegacyApcCacheTest.php | 2 - .../Mapping/LegacyElementMetadataTest.php | 2 - .../Tests/Mapping/MemberMetadataTest.php | 4 - .../Tests/Validator/Abstract2Dot5ApiTest.php | 8 +- .../Tests/Validator/AbstractLegacyApiTest.php | 2 - .../Tests/Validator/AbstractValidatorTest.php | 4 - .../RecursiveValidator2Dot5ApiTest.php | 25 +++ .../Validator/RecursiveValidator.php | 5 +- core/vendor/symfony/yaml/Inline.php | 2 +- core/vendor/symfony/yaml/Parser.php | 6 +- core/vendor/symfony/yaml/Tests/InlineTest.php | 20 +- core/vendor/symfony/yaml/Tests/YamlTest.php | 2 - 150 files changed, 960 insertions(+), 675 deletions(-) create mode 100644 core/vendor/symfony/console/Tests/Fixtures/input_option_6.json create mode 100644 core/vendor/symfony/console/Tests/Fixtures/input_option_6.md create mode 100644 core/vendor/symfony/console/Tests/Fixtures/input_option_6.txt create mode 100644 core/vendor/symfony/console/Tests/Fixtures/input_option_6.xml rename core/vendor/symfony/debug/Exception/{FatalBaseException.php => FatalThrowableError.php} (79%) create mode 100644 core/vendor/symfony/http-foundation/Tests/ClockMock.php create mode 100644 core/vendor/symfony/http-foundation/Tests/File/Fixtures/other-file.example diff --git a/core/composer.lock b/core/composer.lock index 0ee64d874658..8d48134662ae 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -2194,16 +2194,16 @@ }, { "name": "symfony/browser-kit", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/BrowserKit.git", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672" + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/d0a144a1a96d5dc90bed2814b2096a1322761672", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/176905d3d74c2f99e6ab70f4f5a89460532495ae", + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae", "shasum": "" }, "require": { @@ -2245,20 +2245,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2015-06-04 20:11:48" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/class-loader", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/ClassLoader.git", - "reference": "84843730de48ca0feba91004a03c7c952f8ea1da" + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/84843730de48ca0feba91004a03c7c952f8ea1da", - "reference": "84843730de48ca0feba91004a03c7c952f8ea1da", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", "shasum": "" }, "require": { @@ -2295,20 +2295,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-06-25 12:52:11" }, { "name": "symfony/console", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806" + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/564398bc1f33faf92fc2ec86859983d30eb81806", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806", + "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed", + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed", "shasum": "" }, "require": { @@ -2352,11 +2352,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/css-selector", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", @@ -2409,16 +2409,16 @@ }, { "name": "symfony/debug", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "075070230c5bbc65abde8241191655bbce0716e2" + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/075070230c5bbc65abde8241191655bbce0716e2", - "reference": "075070230c5bbc65abde8241191655bbce0716e2", + "url": "https://api.github.com/repos/symfony/Debug/zipball/9daa1bf9f7e615fa2fba30357e479a90141222e3", + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3", "shasum": "" }, "require": { @@ -2465,20 +2465,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/dependency-injection", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d" + "reference": "d56b1b89a0c8b34a6eca6211ec76c43256ec4030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/1a409e52a38ec891de0a7a61a191d1c62080b69d", - "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/d56b1b89a0c8b34a6eca6211ec76c43256ec4030", + "reference": "d56b1b89a0c8b34a6eca6211ec76c43256ec4030", "shasum": "" }, "require": { @@ -2525,20 +2525,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2015-06-11 19:13:11" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/dom-crawler", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3" + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/11d8eb8ccc1533f4c2d89a025f674894fda520b3", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/9dabece63182e95c42b06967a0d929a5df78bc35", + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35", "shasum": "" }, "require": { @@ -2578,20 +2578,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2015-05-22 14:54:25" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9" + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/be3c5ff8d503c46768aeb78ce6333051aa6f26d9", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", "shasum": "" }, "require": { @@ -2636,20 +2636,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-06-18 19:21:56" }, { "name": "symfony/http-foundation", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff" + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/4f363c426b0ced57e3d14460022feb63937980ff", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/88903c0531b90d4ecd90282b18f08c0c77bde0b2", + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2", "shasum": "" }, "require": { @@ -2689,20 +2689,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/http-kernel", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "208101c7a11e31933183bd2a380486e528c74302" + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/208101c7a11e31933183bd2a380486e528c74302", - "reference": "208101c7a11e31933183bd2a380486e528c74302", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/4a8a6f2a847475b3a38da50363a07f69b5cbf37e", + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e", "shasum": "" }, "require": { @@ -2769,20 +2769,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2015-06-11 21:15:28" + "time": "2015-07-13 19:27:49" }, { "name": "symfony/process", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1" + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/552d8efdc80980cbcca50b28d626ac8e36e3cdd1", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", "shasum": "" }, "require": { @@ -2818,7 +2818,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-01 11:25:50" }, { "name": "symfony/psr-http-message-bridge", @@ -2876,16 +2876,16 @@ }, { "name": "symfony/routing", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "5581be29185b8fb802398904555f70da62f6d50d" + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/5581be29185b8fb802398904555f70da62f6d50d", - "reference": "5581be29185b8fb802398904555f70da62f6d50d", + "url": "https://api.github.com/repos/symfony/Routing/zipball/ea9134f277162b02e5f80ac058b75a77637b0d26", + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26", "shasum": "" }, "require": { @@ -2943,20 +2943,20 @@ "uri", "url" ], - "time": "2015-06-11 17:20:40" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/serializer", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Serializer.git", - "reference": "edf2820c4948389e3f168a0160151806cefd6ac3" + "reference": "4ce2211d3a5d3a3605de7cc040af2808882f3c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Serializer/zipball/edf2820c4948389e3f168a0160151806cefd6ac3", - "reference": "edf2820c4948389e3f168a0160151806cefd6ac3", + "url": "https://api.github.com/repos/symfony/Serializer/zipball/4ce2211d3a5d3a3605de7cc040af2808882f3c95", + "reference": "4ce2211d3a5d3a3605de7cc040af2808882f3c95", "shasum": "" }, "require": { @@ -3004,20 +3004,20 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-08 06:12:51" }, { "name": "symfony/translation", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b" + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/8349a2b0d11bd0311df9e8914408080912983a0b", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b", + "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", "shasum": "" }, "require": { @@ -3065,20 +3065,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2015-06-11 17:26:34" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/validator", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Validator.git", - "reference": "3c58b1ef26ab2114f8f84d1808937b9b76bad8f5" + "reference": "26a190dbdf7a19fc2251c2d59547a717918b6c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Validator/zipball/3c58b1ef26ab2114f8f84d1808937b9b76bad8f5", - "reference": "3c58b1ef26ab2114f8f84d1808937b9b76bad8f5", + "url": "https://api.github.com/repos/symfony/Validator/zipball/26a190dbdf7a19fc2251c2d59547a717918b6c77", + "reference": "26a190dbdf7a19fc2251c2d59547a717918b6c77", "shasum": "" }, "require": { @@ -3135,20 +3135,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-02 06:17:05" }, { "name": "symfony/yaml", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", "shasum": "" }, "require": { @@ -3184,7 +3184,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-01 11:25:50" }, { "name": "twig/twig", diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 36a7285271eb..4d6f648ab878 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -2589,17 +2589,17 @@ }, { "name": "symfony/class-loader", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/ClassLoader.git", - "reference": "84843730de48ca0feba91004a03c7c952f8ea1da" + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/84843730de48ca0feba91004a03c7c952f8ea1da", - "reference": "84843730de48ca0feba91004a03c7c952f8ea1da", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", "shasum": "" }, "require": { @@ -2609,7 +2609,7 @@ "symfony/finder": "~2.0,>=2.0.5", "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-08 09:37:21", + "time": "2015-06-25 12:52:11", "type": "library", "extra": { "branch-alias": { @@ -2641,17 +2641,17 @@ }, { "name": "symfony/console", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806" + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/564398bc1f33faf92fc2ec86859983d30eb81806", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806", + "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed", + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed", "shasum": "" }, "require": { @@ -2668,7 +2668,7 @@ "symfony/event-dispatcher": "", "symfony/process": "" }, - "time": "2015-06-10 15:30:22", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -2700,8 +2700,8 @@ }, { "name": "symfony/css-selector", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", @@ -2755,17 +2755,17 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d" + "reference": "d56b1b89a0c8b34a6eca6211ec76c43256ec4030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/1a409e52a38ec891de0a7a61a191d1c62080b69d", - "reference": "1a409e52a38ec891de0a7a61a191d1c62080b69d", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/d56b1b89a0c8b34a6eca6211ec76c43256ec4030", + "reference": "d56b1b89a0c8b34a6eca6211ec76c43256ec4030", "shasum": "" }, "require": { @@ -2785,7 +2785,7 @@ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, - "time": "2015-06-11 19:13:11", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -2817,17 +2817,17 @@ }, { "name": "symfony/debug", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "075070230c5bbc65abde8241191655bbce0716e2" + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/075070230c5bbc65abde8241191655bbce0716e2", - "reference": "075070230c5bbc65abde8241191655bbce0716e2", + "url": "https://api.github.com/repos/symfony/Debug/zipball/9daa1bf9f7e615fa2fba30357e479a90141222e3", + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3", "shasum": "" }, "require": { @@ -2847,7 +2847,7 @@ "symfony/http-foundation": "", "symfony/http-kernel": "" }, - "time": "2015-06-08 09:37:21", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -2879,17 +2879,17 @@ }, { "name": "symfony/http-foundation", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff" + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/4f363c426b0ced57e3d14460022feb63937980ff", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/88903c0531b90d4ecd90282b18f08c0c77bde0b2", + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2", "shasum": "" }, "require": { @@ -2899,7 +2899,7 @@ "symfony/expression-language": "~2.4", "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-10 15:30:22", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -2934,17 +2934,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9" + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/be3c5ff8d503c46768aeb78ce6333051aa6f26d9", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", "shasum": "" }, "require": { @@ -2962,7 +2962,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2015-06-08 09:37:21", + "time": "2015-06-18 19:21:56", "type": "library", "extra": { "branch-alias": { @@ -2994,17 +2994,17 @@ }, { "name": "symfony/http-kernel", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "208101c7a11e31933183bd2a380486e528c74302" + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/208101c7a11e31933183bd2a380486e528c74302", - "reference": "208101c7a11e31933183bd2a380486e528c74302", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/4a8a6f2a847475b3a38da50363a07f69b5cbf37e", + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e", "shasum": "" }, "require": { @@ -3044,7 +3044,7 @@ "symfony/finder": "", "symfony/var-dumper": "" }, - "time": "2015-06-11 21:15:28", + "time": "2015-07-13 19:27:49", "type": "library", "extra": { "branch-alias": { @@ -3076,17 +3076,17 @@ }, { "name": "symfony/routing", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "5581be29185b8fb802398904555f70da62f6d50d" + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/5581be29185b8fb802398904555f70da62f6d50d", - "reference": "5581be29185b8fb802398904555f70da62f6d50d", + "url": "https://api.github.com/repos/symfony/Routing/zipball/ea9134f277162b02e5f80ac058b75a77637b0d26", + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26", "shasum": "" }, "require": { @@ -3111,7 +3111,7 @@ "symfony/expression-language": "For using expression matching", "symfony/yaml": "For using the YAML loader" }, - "time": "2015-06-11 17:20:40", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -3149,17 +3149,17 @@ }, { "name": "symfony/serializer", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Serializer.git", - "reference": "edf2820c4948389e3f168a0160151806cefd6ac3" + "reference": "4ce2211d3a5d3a3605de7cc040af2808882f3c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Serializer/zipball/edf2820c4948389e3f168a0160151806cefd6ac3", - "reference": "edf2820c4948389e3f168a0160151806cefd6ac3", + "url": "https://api.github.com/repos/symfony/Serializer/zipball/4ce2211d3a5d3a3605de7cc040af2808882f3c95", + "reference": "4ce2211d3a5d3a3605de7cc040af2808882f3c95", "shasum": "" }, "require": { @@ -3180,7 +3180,7 @@ "symfony/property-access": "For using the ObjectNormalizer.", "symfony/yaml": "For using the default YAML mapping loader." }, - "time": "2015-06-08 09:37:21", + "time": "2015-07-08 06:12:51", "type": "library", "extra": { "branch-alias": { @@ -3212,17 +3212,17 @@ }, { "name": "symfony/translation", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b" + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/8349a2b0d11bd0311df9e8914408080912983a0b", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b", + "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", "shasum": "" }, "require": { @@ -3243,7 +3243,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2015-06-11 17:26:34", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -3275,17 +3275,17 @@ }, { "name": "symfony/validator", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Validator.git", - "reference": "3c58b1ef26ab2114f8f84d1808937b9b76bad8f5" + "reference": "26a190dbdf7a19fc2251c2d59547a717918b6c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Validator/zipball/3c58b1ef26ab2114f8f84d1808937b9b76bad8f5", - "reference": "3c58b1ef26ab2114f8f84d1808937b9b76bad8f5", + "url": "https://api.github.com/repos/symfony/Validator/zipball/26a190dbdf7a19fc2251c2d59547a717918b6c77", + "reference": "26a190dbdf7a19fc2251c2d59547a717918b6c77", "shasum": "" }, "require": { @@ -3315,7 +3315,7 @@ "symfony/property-access": "For using the 2.4 Validator API", "symfony/yaml": "" }, - "time": "2015-06-08 09:37:21", + "time": "2015-07-02 06:17:05", "type": "library", "extra": { "branch-alias": { @@ -3347,17 +3347,17 @@ }, { "name": "symfony/process", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1" + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/552d8efdc80980cbcca50b28d626ac8e36e3cdd1", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", "shasum": "" }, "require": { @@ -3366,7 +3366,7 @@ "require-dev": { "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-08 09:37:21", + "time": "2015-07-01 11:25:50", "type": "library", "extra": { "branch-alias": { @@ -3398,17 +3398,17 @@ }, { "name": "symfony/yaml", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", "shasum": "" }, "require": { @@ -3417,7 +3417,7 @@ "require-dev": { "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-10 15:30:22", + "time": "2015-07-01 11:25:50", "type": "library", "extra": { "branch-alias": { @@ -3449,17 +3449,17 @@ }, { "name": "symfony/dom-crawler", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3" + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/11d8eb8ccc1533f4c2d89a025f674894fda520b3", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/9dabece63182e95c42b06967a0d929a5df78bc35", + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35", "shasum": "" }, "require": { @@ -3472,7 +3472,7 @@ "suggest": { "symfony/css-selector": "" }, - "time": "2015-05-22 14:54:25", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { @@ -3504,17 +3504,17 @@ }, { "name": "symfony/browser-kit", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.2", + "version_normalized": "2.7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/BrowserKit.git", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672" + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/d0a144a1a96d5dc90bed2814b2096a1322761672", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/176905d3d74c2f99e6ab70f4f5a89460532495ae", + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae", "shasum": "" }, "require": { @@ -3529,7 +3529,7 @@ "suggest": { "symfony/process": "" }, - "time": "2015-06-04 20:11:48", + "time": "2015-07-09 16:07:40", "type": "library", "extra": { "branch-alias": { diff --git a/core/vendor/symfony/browser-kit/Cookie.php b/core/vendor/symfony/browser-kit/Cookie.php index 424f78bab4f4..e690cdacd511 100644 --- a/core/vendor/symfony/browser-kit/Cookie.php +++ b/core/vendor/symfony/browser-kit/Cookie.php @@ -77,12 +77,11 @@ public function __construct($name, $value, $expires = null, $path = null, $domai if (null !== $expires) { $timestampAsDateTime = \DateTime::createFromFormat('U', $expires); if (false === $timestampAsDateTime) { - throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.'), $expires); + throw new \UnexpectedValueException(sprintf('The cookie expiration time "%s" is not valid.', $expires)); } $this->expires = $timestampAsDateTime->getTimestamp(); } - } /** diff --git a/core/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php b/core/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php index 88099258eccc..29c3288347dc 100644 --- a/core/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php +++ b/core/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php @@ -22,7 +22,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase public function prepare_workspace() { - $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000); + $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000); mkdir($this->workspace, 0777, true); $this->workspace = realpath($this->workspace); } diff --git a/core/vendor/symfony/class-loader/Tests/LegacyApcUniversalClassLoaderTest.php b/core/vendor/symfony/class-loader/Tests/LegacyApcUniversalClassLoaderTest.php index 48b46fa3ecb6..0268a1c4563a 100644 --- a/core/vendor/symfony/class-loader/Tests/LegacyApcUniversalClassLoaderTest.php +++ b/core/vendor/symfony/class-loader/Tests/LegacyApcUniversalClassLoaderTest.php @@ -20,8 +20,6 @@ class LegacyApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - if (!extension_loaded('apc')) { $this->markTestSkipped('The apc extension is not available.'); } diff --git a/core/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php b/core/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php index 9149e2e863ea..2588e9603443 100644 --- a/core/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php +++ b/core/vendor/symfony/class-loader/Tests/LegacyUniversalClassLoaderTest.php @@ -18,11 +18,6 @@ */ class LegacyUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - /** * @dataProvider getLoadClassTests */ diff --git a/core/vendor/symfony/console/Application.php b/core/vendor/symfony/console/Application.php index 4fa5fb9f0d51..c816f015b370 100644 --- a/core/vendor/symfony/console/Application.php +++ b/core/vendor/symfony/console/Application.php @@ -1142,7 +1142,7 @@ private function splitStringByWidth($string, $width) $lines[] = str_pad($line, $width); $line = $char; } - if (strlen($line)) { + if ('' !== $line) { $lines[] = count($lines) ? str_pad($line, $width) : $line; } diff --git a/core/vendor/symfony/console/Descriptor/TextDescriptor.php b/core/vendor/symfony/console/Descriptor/TextDescriptor.php index 0824463fce96..5c3fea9a2caf 100644 --- a/core/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/core/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -40,7 +40,7 @@ protected function describeInputArgument(InputArgument $argument, array $options $totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument->getName()); $spacingWidth = $totalWidth - strlen($argument->getName()) + 2; - $this->writeText(sprintf(" <info>%s</info>%s%s%s", + $this->writeText(sprintf(' <info>%s</info>%s%s%s', $argument->getName(), str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + <info> + </info> + 2 spaces @@ -77,7 +77,7 @@ protected function describeInputOption(InputOption $option, array $options = arr $spacingWidth = $totalWidth - strlen($synopsis) + 2; - $this->writeText(sprintf(" <info>%s</info>%s%s%s%s", + $this->writeText(sprintf(' <info>%s</info>%s%s%s%s', $synopsis, str_repeat(' ', $spacingWidth), // + 17 = 2 spaces + <info> + </info> + 2 spaces @@ -207,7 +207,7 @@ protected function describeApplication(Application $application, array $options foreach ($namespace['commands'] as $name) { $this->writeText("\n"); $spacingWidth = $width - strlen($name); - $this->writeText(sprintf(" <info>%s</info>%s%s", $name, str_repeat(' ', $spacingWidth), $description->getCommand($name)->getDescription()), $options); + $this->writeText(sprintf(' <info>%s</info>%s%s', $name, str_repeat(' ', $spacingWidth), $description->getCommand($name)->getDescription()), $options); } } @@ -266,7 +266,8 @@ private function calculateTotalWidthForOptions($options) { $totalWidth = 0; foreach ($options as $option) { - $nameLength = 4 + strlen($option->getName()) + 2; // - + shortcut + , + whitespace + name + -- + // "-" + shortcut + ", --" + name + $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + strlen($option->getName()); if ($option->acceptValue()) { $valueLength = 1 + strlen($option->getName()); // = + value diff --git a/core/vendor/symfony/console/Formatter/OutputFormatter.php b/core/vendor/symfony/console/Formatter/OutputFormatter.php index a053ac6ba096..331b204fec8e 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatter.php @@ -33,7 +33,7 @@ class OutputFormatter implements OutputFormatterInterface */ public static function escape($text) { - return preg_replace('/([^\\\\]?)</is', '$1\\<', $text); + return preg_replace('/([^\\\\]?)</', '$1\\<', $text); } /** @@ -146,7 +146,7 @@ public function format($message) $offset = 0; $output = ''; $tagRegex = '[a-z][a-z0-9_=;-]*'; - preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE); + preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE); foreach ($matches[0] as $i => $match) { $pos = $match[1]; $text = $match[0]; diff --git a/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php index b3f274a8b0b8..ee62cdbd61dd 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -29,6 +29,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'magenta' => array('set' => 35, 'unset' => 39), 'cyan' => array('set' => 36, 'unset' => 39), 'white' => array('set' => 37, 'unset' => 39), + 'default' => array('set' => 39, 'unset' => 39), ); private static $availableBackgroundColors = array( 'black' => array('set' => 40, 'unset' => 49), @@ -39,6 +40,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'magenta' => array('set' => 45, 'unset' => 49), 'cyan' => array('set' => 46, 'unset' => 49), 'white' => array('set' => 47, 'unset' => 49), + 'default' => array('set' => 49, 'unset' => 49), ); private static $availableOptions = array( 'bold' => array('set' => 1, 'unset' => 22), diff --git a/core/vendor/symfony/console/Helper/DebugFormatterHelper.php b/core/vendor/symfony/console/Helper/DebugFormatterHelper.php index cdb620d1684b..0b4b9379020d 100644 --- a/core/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/core/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -20,7 +20,7 @@ */ class DebugFormatterHelper extends Helper { - private $colors = array('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'); + private $colors = array('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'); private $started = array(); private $count = -1; diff --git a/core/vendor/symfony/console/Helper/DialogHelper.php b/core/vendor/symfony/console/Helper/DialogHelper.php index 5bea3038da4d..a280b49c1983 100644 --- a/core/vendor/symfony/console/Helper/DialogHelper.php +++ b/core/vendor/symfony/console/Helper/DialogHelper.php @@ -466,18 +466,18 @@ private function hasSttyAvailable() */ private function validateAttempts($interviewer, OutputInterface $output, $validator, $attempts) { - $error = null; + $e = null; while (false === $attempts || $attempts--) { - if (null !== $error) { - $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error')); + if (null !== $e) { + $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($e->getMessage(), 'error')); } try { return call_user_func($validator, $interviewer()); - } catch (\Exception $error) { + } catch (\Exception $e) { } } - throw $error; + throw $e; } } diff --git a/core/vendor/symfony/console/Helper/ProgressBar.php b/core/vendor/symfony/console/Helper/ProgressBar.php index 60308bc386f3..e5ba92773889 100644 --- a/core/vendor/symfony/console/Helper/ProgressBar.php +++ b/core/vendor/symfony/console/Helper/ProgressBar.php @@ -374,7 +374,7 @@ public function setCurrent($step) } /** - * Sets whether to overwrite the progressbar, false for new line + * Sets whether to overwrite the progressbar, false for new line. * * @param bool $overwrite */ @@ -401,8 +401,8 @@ public function setProgress($step) $this->max = $step; } - $prevPeriod = intval($this->step / $this->redrawFreq); - $currPeriod = intval($step / $this->redrawFreq); + $prevPeriod = (int) ($this->step / $this->redrawFreq); + $currPeriod = (int) ($step / $this->redrawFreq); $this->step = $step; $this->percent = $this->max ? (float) $this->step / $this->max : 0; if ($prevPeriod !== $currPeriod || $this->max === $step) { diff --git a/core/vendor/symfony/console/Helper/Table.php b/core/vendor/symfony/console/Helper/Table.php index 392d4652ef58..9e86c856d05e 100644 --- a/core/vendor/symfony/console/Helper/Table.php +++ b/core/vendor/symfony/console/Helper/Table.php @@ -171,7 +171,7 @@ public function addRow($row) if ($row instanceof TableSeparator) { $this->rows[] = $row; - return; + return $this; } if (!is_array($row)) { diff --git a/core/vendor/symfony/console/Input/ArgvInput.php b/core/vendor/symfony/console/Input/ArgvInput.php index 97b0cfc05d21..43cbe725fb26 100644 --- a/core/vendor/symfony/console/Input/ArgvInput.php +++ b/core/vendor/symfony/console/Input/ArgvInput.php @@ -221,7 +221,7 @@ private function addLongOption($name, $value) } if (null !== $value && !$option->acceptValue()) { - throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name, $value)); + throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); } if (null === $value && $option->acceptValue() && count($this->parsed)) { diff --git a/core/vendor/symfony/console/Output/ConsoleOutput.php b/core/vendor/symfony/console/Output/ConsoleOutput.php index 3560f1c6fc5a..708d171445ba 100644 --- a/core/vendor/symfony/console/Output/ConsoleOutput.php +++ b/core/vendor/symfony/console/Output/ConsoleOutput.php @@ -30,6 +30,9 @@ */ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { + /** + * @var StreamOutput + */ private $stderr; /** @@ -43,14 +46,12 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface */ public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) { - $outputStream = 'php://stdout'; - if (!$this->hasStdoutSupport()) { - $outputStream = 'php://output'; - } + $outputStream = $this->hasStdoutSupport() ? 'php://stdout' : 'php://output'; + $errorStream = $this->hasStderrSupport() ? 'php://stderr' : 'php://output'; parent::__construct(fopen($outputStream, 'w'), $verbosity, $decorated, $formatter); - $this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $this->getFormatter()); + $this->stderr = new StreamOutput(fopen($errorStream, 'w'), $verbosity, $decorated, $this->getFormatter()); } /** @@ -100,14 +101,32 @@ public function setErrorOutput(OutputInterface $error) * Returns true if current environment supports writing console output to * STDOUT. * - * IBM iSeries (OS400) exhibits character-encoding issues when writing to - * STDOUT and doesn't properly convert ASCII to EBCDIC, resulting in garbage - * output. - * * @return bool */ protected function hasStdoutSupport() { - return ('OS400' != php_uname('s')); + return false === $this->isRunningOS400(); + } + + /** + * Returns true if current environment supports writing console output to + * STDERR. + * + * @return bool + */ + protected function hasStderrSupport() + { + return false === $this->isRunningOS400(); + } + + /** + * Checks if current executing environment is IBM iSeries (OS400), which + * doesn't properly convert character-encodings between ASCII to EBCDIC. + * + * @return bool + */ + private function isRunningOS400() + { + return 'OS400' === php_uname('s'); } } diff --git a/core/vendor/symfony/console/Question/ChoiceQuestion.php b/core/vendor/symfony/console/Question/ChoiceQuestion.php index 9586c5bf3ac0..a61b410d519e 100644 --- a/core/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/core/vendor/symfony/console/Question/ChoiceQuestion.php @@ -161,7 +161,8 @@ private function getDefaultValidator() if (false === $result) { throw new \InvalidArgumentException(sprintf($errorMessage, $value)); } - array_push($multiselectChoices, (string) $result); + + $multiselectChoices[] = $choices[(string) $result]; } if ($multiselect) { diff --git a/core/vendor/symfony/console/Shell.php b/core/vendor/symfony/console/Shell.php index 4167746aada7..eaaadfd8a87a 100644 --- a/core/vendor/symfony/console/Shell.php +++ b/core/vendor/symfony/console/Shell.php @@ -206,7 +206,7 @@ private function readline() } else { $this->output->write($this->getPrompt()); $line = fgets(STDIN, 1024); - $line = (!$line && strlen($line) == 0) ? false : rtrim($line); + $line = (false === $line || '' === $line) ? false : rtrim($line); } return $line; diff --git a/core/vendor/symfony/console/Tests/ApplicationTest.php b/core/vendor/symfony/console/Tests/ApplicationTest.php index 1fa6c64af650..dfee2321d5bd 100644 --- a/core/vendor/symfony/console/Tests/ApplicationTest.php +++ b/core/vendor/symfony/console/Tests/ApplicationTest.php @@ -495,8 +495,6 @@ public function testSetCatchExceptions() */ public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); @@ -509,8 +507,6 @@ public function testLegacyAsText() */ public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); @@ -679,7 +675,7 @@ public function testRun() } /** - * Issue #9285 + * Issue #9285. * * If the "verbose" option is just before an argument in ArgvInput, * an argument value should not be treated as verbosity value. diff --git a/core/vendor/symfony/console/Tests/Command/CommandTest.php b/core/vendor/symfony/console/Tests/Command/CommandTest.php index 1f1160efb60b..7702ac8341d1 100644 --- a/core/vendor/symfony/console/Tests/Command/CommandTest.php +++ b/core/vendor/symfony/console/Tests/Command/CommandTest.php @@ -314,8 +314,6 @@ public function callableMethodCommand(InputInterface $input, OutputInterface $ou */ public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); @@ -328,8 +326,6 @@ public function testLegacyAsText() */ public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); diff --git a/core/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/core/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php index 1f40d2e6a02e..45b3b2fff903 100644 --- a/core/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php +++ b/core/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php @@ -42,6 +42,7 @@ public static function getInputOptions() 'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'), 'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()), 'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"), + 'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'), ); } diff --git a/core/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.json new file mode 100644 index 000000000000..d84e8721475f --- /dev/null +++ b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.json @@ -0,0 +1 @@ +{"name":"--option_name","shortcut":"-o|-O","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option with multiple shortcuts","default":null} diff --git a/core/vendor/symfony/console/Tests/Fixtures/input_option_6.md b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.md new file mode 100644 index 000000000000..ed1ea1c84bd5 --- /dev/null +++ b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.md @@ -0,0 +1,9 @@ +**option_name:** + +* Name: `--option_name` +* Shortcut: `-o|-O` +* Accept value: yes +* Is value required: yes +* Is multiple: no +* Description: option with multiple shortcuts +* Default: `NULL` diff --git a/core/vendor/symfony/console/Tests/Fixtures/input_option_6.txt b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.txt new file mode 100644 index 000000000000..0e6c9759b577 --- /dev/null +++ b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.txt @@ -0,0 +1 @@ + <info>-o|O, --option_name=OPTION_NAME</info> option with multiple shortcuts diff --git a/core/vendor/symfony/console/Tests/Fixtures/input_option_6.xml b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.xml new file mode 100644 index 000000000000..06126a2f570d --- /dev/null +++ b/core/vendor/symfony/console/Tests/Fixtures/input_option_6.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<option name="--option_name" shortcut="-o" shortcuts="-o|-O" accept_value="1" is_value_required="1" is_multiple="0"> + <description>option with multiple shortcuts</description> + <defaults/> +</option> diff --git a/core/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/core/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php index 52ada9e97221..0abfb3ce2755 100644 --- a/core/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php +++ b/core/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php @@ -37,6 +37,9 @@ public function testForeground() $style->setForeground('blue'); $this->assertEquals("\033[34mfoo\033[39m", $style->apply('foo')); + $style->setForeground('default'); + $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo')); + $this->setExpectedException('InvalidArgumentException'); $style->setForeground('undefined-color'); } @@ -51,6 +54,9 @@ public function testBackground() $style->setBackground('yellow'); $this->assertEquals("\033[43mfoo\033[49m", $style->apply('foo')); + $style->setBackground('default'); + $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo')); + $this->setExpectedException('InvalidArgumentException'); $style->setBackground('undefined-color'); } diff --git a/core/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php b/core/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php index cf07793c3d4d..e130cdc6bc23 100644 --- a/core/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php +++ b/core/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php @@ -22,11 +22,6 @@ */ class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - public function testSelect() { $dialog = new DialogHelper(); diff --git a/core/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php b/core/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php index e93057a16489..7b9cf29f0d35 100644 --- a/core/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php +++ b/core/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php @@ -19,11 +19,6 @@ */ class LegacyProgressHelperTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - public function testAdvance() { $progress = new ProgressHelper(); diff --git a/core/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php b/core/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php index b7e31596f7de..3b324237e260 100644 --- a/core/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php +++ b/core/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php @@ -23,7 +23,6 @@ class LegacyTableHelperTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->stream = fopen('php://memory', 'r+'); } diff --git a/core/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/core/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php index 2e333dc05e64..9f83885a50d4 100644 --- a/core/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php +++ b/core/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php @@ -13,7 +13,6 @@ use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Process\Process; @@ -59,7 +58,7 @@ public function provideCommandsAndOutput() EOT; $successOutputDebugWithTags = <<<EOT - RUN php -r "echo \"<info>42</info>\";" + RUN php -r "echo '<info>42</info>';" OUT <info>42</info> RES Command ran successfully @@ -92,7 +91,7 @@ public function provideCommandsAndOutput() array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null), array($successOutputVerbose, 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERY_VERBOSE, null), array($successOutputDebug, 'php -r "echo 42;"', StreamOutput::VERBOSITY_DEBUG, null), - array($successOutputDebugWithTags, 'php -r "echo \"<info>42</info>\";"', StreamOutput::VERBOSITY_DEBUG, null), + array($successOutputDebugWithTags, 'php -r "echo \'<info>42</info>\';"', StreamOutput::VERBOSITY_DEBUG, null), array('', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null), array($syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null), array($syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null), diff --git a/core/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/core/vendor/symfony/console/Tests/Helper/ProgressBarTest.php index 59c06bbeeb07..97b99efe7472 100644 --- a/core/vendor/symfony/console/Tests/Helper/ProgressBarTest.php +++ b/core/vendor/symfony/console/Tests/Helper/ProgressBarTest.php @@ -323,17 +323,17 @@ public function testNonDecoratedOutput() rewind($output->getStream()); $this->assertEquals( - " 0/200 [>---------------------------] 0%\n". - " 20/200 [==>-------------------------] 10%\n". - " 40/200 [=====>----------------------] 20%\n". - " 60/200 [========>-------------------] 30%\n". - " 80/200 [===========>----------------] 40%\n". - " 100/200 [==============>-------------] 50%\n". - " 120/200 [================>-----------] 60%\n". - " 140/200 [===================>--------] 70%\n". - " 160/200 [======================>-----] 80%\n". - " 180/200 [=========================>--] 90%\n". - " 200/200 [============================] 100%", + ' 0/200 [>---------------------------] 0%'.PHP_EOL. + ' 20/200 [==>-------------------------] 10%'.PHP_EOL. + ' 40/200 [=====>----------------------] 20%'.PHP_EOL. + ' 60/200 [========>-------------------] 30%'.PHP_EOL. + ' 80/200 [===========>----------------] 40%'.PHP_EOL. + ' 100/200 [==============>-------------] 50%'.PHP_EOL. + ' 120/200 [================>-----------] 60%'.PHP_EOL. + ' 140/200 [===================>--------] 70%'.PHP_EOL. + ' 160/200 [======================>-----] 80%'.PHP_EOL. + ' 180/200 [=========================>--] 90%'.PHP_EOL. + ' 200/200 [============================] 100%', stream_get_contents($output->getStream()) ); } @@ -349,9 +349,9 @@ public function testNonDecoratedOutputWithClear() rewind($output->getStream()); $this->assertEquals( - " 0/50 [>---------------------------] 0%\n". - " 25/50 [==============>-------------] 50%\n". - " 50/50 [============================] 100%", + ' 0/50 [>---------------------------] 0%'.PHP_EOL. + ' 25/50 [==============>-------------] 50%'.PHP_EOL. + ' 50/50 [============================] 100%', stream_get_contents($output->getStream()) ); } @@ -364,8 +364,8 @@ public function testNonDecoratedOutputWithoutMax() rewind($output->getStream()); $this->assertEquals( - " 0 [>---------------------------]\n". - " 1 [->--------------------------]", + ' 0 [>---------------------------]'.PHP_EOL. + ' 1 [->--------------------------]', stream_get_contents($output->getStream()) ); } @@ -500,7 +500,7 @@ public function testAnsiColorsAndEmojis() $mem = 100000 * $i; $colors = $i++ ? '41;37' : '44;37'; - return "\033[".$colors."m ".Helper::formatMemory($mem)." \033[0m"; + return "\033[".$colors.'m '.Helper::formatMemory($mem)." \033[0m"; }); $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n ðŸ %remaining:-10s% %memory:37s%"); $bar->setBarCharacter($done = "\033[32mâ—\033[0m"); @@ -518,17 +518,17 @@ public function testAnsiColorsAndEmojis() $this->assertEquals( $this->generateOutput( " \033[44;37m Starting the demo... fingers crossed \033[0m\n". - " 0/15 ".$progress.str_repeat($empty, 26)." 0%\n". + ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n". " \xf0\x9f\x8f\x81 1 sec \033[44;37m 0 B \033[0m" ). $this->generateOutput( " \033[44;37m Looks good to me... \033[0m\n". - " 4/15 ".str_repeat($done, 7).$progress.str_repeat($empty, 19)." 26%\n". + ' 4/15 '.str_repeat($done, 7).$progress.str_repeat($empty, 19)." 26%\n". " \xf0\x9f\x8f\x81 1 sec \033[41;37m 97 KiB \033[0m" ). $this->generateOutput( " \033[44;37m Thanks, bye \033[0m\n". - " 15/15 ".str_repeat($done, 28)." 100%\n". + ' 15/15 '.str_repeat($done, 28)." 100%\n". " \xf0\x9f\x8f\x81 1 sec \033[41;37m 195 KiB \033[0m" ), stream_get_contents($output->getStream()) @@ -570,7 +570,7 @@ public function testFormatsWithoutMax($format) } /** - * Provides each defined format + * Provides each defined format. * * @return array */ diff --git a/core/vendor/symfony/console/Tests/Helper/TableTest.php b/core/vendor/symfony/console/Tests/Helper/TableTest.php index 3db51f45b0ab..2a66caa046be 100644 --- a/core/vendor/symfony/console/Tests/Helper/TableTest.php +++ b/core/vendor/symfony/console/Tests/Helper/TableTest.php @@ -180,10 +180,10 @@ public function testRenderProvider() array( array('ISBN', 'Title', 'Author'), array( - array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"), - array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"), + array('99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'), + array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"), ), 'default', <<<TABLE @@ -550,6 +550,8 @@ public function testRowSeparator() TABLE; $this->assertEquals($expected, $this->getOutputContent($output)); + + $this->assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works'); } protected function getOutputStream() diff --git a/core/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/core/vendor/symfony/console/Tests/Input/InputDefinitionTest.php index 74d755f54e2f..7e0a24258f3c 100644 --- a/core/vendor/symfony/console/Tests/Input/InputDefinitionTest.php +++ b/core/vendor/symfony/console/Tests/Input/InputDefinitionTest.php @@ -376,7 +376,7 @@ public function getGetSynopsisData() array(new InputDefinition(array(new InputOption('foo'), new InputArgument('foo', InputArgument::REQUIRED))), '[--foo] [--] <foo>', 'puts [--] between options and arguments'), ); } - + public function testGetShortSynopsis() { $definition = new InputDefinition(array(new InputOption('foo'), new InputOption('bar'), new InputArgument('cat'))); @@ -388,8 +388,6 @@ public function testGetShortSynopsis() */ public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), @@ -400,7 +398,7 @@ public function testLegacyAsText() new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')), new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')), )); - + $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); } @@ -409,8 +407,6 @@ public function testLegacyAsText() */ public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), diff --git a/core/vendor/symfony/console/Tests/Input/StringInputTest.php b/core/vendor/symfony/console/Tests/Input/StringInputTest.php index 575d527cbe75..ccf9289cf357 100644 --- a/core/vendor/symfony/console/Tests/Input/StringInputTest.php +++ b/core/vendor/symfony/console/Tests/Input/StringInputTest.php @@ -46,8 +46,6 @@ public function testInputOptionWithGivenString() */ public function testLegacyInputOptionDefinitionInConstructor() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $definition = new InputDefinition( array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) ); diff --git a/core/vendor/symfony/debug/DebugClassLoader.php b/core/vendor/symfony/debug/DebugClassLoader.php index 01104ea21e0c..a2532d3038d6 100644 --- a/core/vendor/symfony/debug/DebugClassLoader.php +++ b/core/vendor/symfony/debug/DebugClassLoader.php @@ -179,7 +179,7 @@ public function loadClass($class) } if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) { - trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED); + @trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED); } elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) { self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]); } else { @@ -222,7 +222,7 @@ public function loadClass($class) } if (self::$caseCheck && preg_match('#([/\\\\][a-zA-Z_\x7F-\xFF][a-zA-Z0-9_\x7F-\xFF]*)+\.(php|hh)$#D', $file, $tail)) { $tail = $tail[0]; - $real = $refl->getFilename(); + $real = $refl->getFileName(); if (2 === self::$caseCheck) { // realpath() on MacOSX doesn't normalize the case of characters diff --git a/core/vendor/symfony/debug/ErrorHandler.php b/core/vendor/symfony/debug/ErrorHandler.php index 112ba031cea7..2d8a9167b20b 100644 --- a/core/vendor/symfony/debug/ErrorHandler.php +++ b/core/vendor/symfony/debug/ErrorHandler.php @@ -14,8 +14,8 @@ use Psr\Log\LogLevel; use Psr\Log\LoggerInterface; use Symfony\Component\Debug\Exception\ContextErrorException; -use Symfony\Component\Debug\Exception\FatalBaseException; use Symfony\Component\Debug\Exception\FatalErrorException; +use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\Debug\Exception\OutOfMemoryException; use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler; use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler; @@ -350,7 +350,7 @@ private function reRegister($prev) * * @internal */ - public function handleError($type, $message, $file, $line, array $context) + public function handleError($type, $message, $file, $line, array $context, array $backtrace = null) { $level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR; $log = $this->loggedErrors & $type; @@ -367,6 +367,15 @@ public function handleError($type, $message, $file, $line, array $context) $context = $e; } + if (null !== $backtrace && $type & E_ERROR) { + // E_ERROR fatal errors are triggered on HHVM when + // hhvm.error_handling.call_user_handler_on_fatals=1 + // which is the way to get their backtrace. + $this->handleFatalError(compact('type', 'message', 'file', 'line', 'backtrace')); + + return true; + } + if ($throw) { if (($this->scopedErrors & $type) && class_exists('Symfony\Component\Debug\Exception\ContextErrorException')) { // Checking for class existence is a work around for https://bugs.php.net/42098 @@ -402,17 +411,24 @@ public function handleError($type, $message, $file, $line, array $context) if ($this->scopedErrors & $type) { $e['scope_vars'] = $context; if ($trace) { - $e['stack'] = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT); + $e['stack'] = $backtrace ?: debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT); } } elseif ($trace) { - $e['stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + if (null === $backtrace) { + $e['stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + } else { + foreach ($backtrace as &$frame) { + unset($frame['args'], $frame); + } + $e['stack'] = $backtrace; + } } } if ($this->isRecursive) { $log = 0; } elseif (self::$stackedErrorLevels) { - self::$stackedErrors[] = array($this->loggers[$type], $message, $e); + self::$stackedErrors[] = array($this->loggers[$type][0], ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $message, $e); } else { try { $this->isRecursive = true; @@ -431,15 +447,15 @@ public function handleError($type, $message, $file, $line, array $context) /** * Handles an exception by logging then forwarding it to an other handler. * - * @param \Exception|\BaseException $exception An exception to handle - * @param array $error An array as returned by error_get_last() + * @param \Exception|\Throwable $exception An exception to handle + * @param array $error An array as returned by error_get_last() * * @internal */ public function handleException($exception, array $error = null) { if (!$exception instanceof \Exception) { - $exception = new FatalBaseException($exception); + $exception = new FatalThrowableError($exception); } $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR; @@ -451,15 +467,17 @@ public function handleException($exception, array $error = null) 'level' => error_reporting(), 'stack' => $exception->getTrace(), ); - if ($exception instanceof FatalBaseException) { - $error = array( - 'type' => $type, - 'message' => $message = $exception->getMessage(), - 'file' => $e['file'], - 'line' => $e['line'], - ); - } elseif ($exception instanceof FatalErrorException) { - $message = 'Fatal '.$exception->getMessage(); + if ($exception instanceof FatalErrorException) { + if ($exception instanceof FatalThrowableError) { + $error = array( + 'type' => $type, + 'message' => $message = $exception->getMessage(), + 'file' => $e['file'], + 'line' => $e['line'], + ); + } else { + $message = 'Fatal '.$exception->getMessage(); + } } elseif ($exception instanceof \ErrorException) { $message = 'Uncaught '.$exception->getMessage(); if ($exception instanceof ContextErrorException) { @@ -486,9 +504,9 @@ public function handleException($exception, array $error = null) try { call_user_func($this->exceptionHandler, $exception); } catch (\Exception $handlerException) { - $this->exceptionHandler = null; - $this->handleException($handlerException); - } catch (\BaseException $handlerException) { + } catch (\Throwable $handlerException) { + } + if (isset($handlerException)) { $this->exceptionHandler = null; $this->handleException($handlerException); } @@ -503,7 +521,11 @@ public function handleException($exception, array $error = null) */ public static function handleFatalError(array $error = null) { - self::$reservedMemory = ''; + if (null === self::$reservedMemory) { + return; + } + + self::$reservedMemory = null; $handler = set_error_handler('var_dump', 0); $handler = is_array($handler) ? $handler[0] : null; @@ -525,14 +547,15 @@ public static function handleFatalError(array $error = null) // Handled below } - if ($error && ($error['type'] & (E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR))) { + if ($error && $error['type'] &= E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR) { // Let's not throw anymore but keep logging $handler->throwAt(0, true); + $trace = isset($error['backtrace']) ? $error['backtrace'] : null; if (0 === strpos($error['message'], 'Allowed memory') || 0 === strpos($error['message'], 'Out of memory')) { - $exception = new OutOfMemoryException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, false); + $exception = new OutOfMemoryException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, false, $trace); } else { - $exception = new FatalErrorException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, true); + $exception = new FatalErrorException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, true, $trace); } } elseif (!isset($exception)) { return; @@ -581,7 +604,7 @@ public static function unstackErrors() self::$stackedErrors = array(); foreach ($errors as $e) { - $e[0][0]->log($e[0][1], $e[1], $e[2]); + $e[0]->log($e[1], $e[2], $e[3]); } } } diff --git a/core/vendor/symfony/debug/Exception/FatalErrorException.php b/core/vendor/symfony/debug/Exception/FatalErrorException.php index 41bb97c6a9c1..db2fb43bbceb 100644 --- a/core/vendor/symfony/debug/Exception/FatalErrorException.php +++ b/core/vendor/symfony/debug/Exception/FatalErrorException.php @@ -35,11 +35,19 @@ class FatalErrorException extends \ErrorException */ class FatalErrorException extends LegacyFatalErrorException { - public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true) + public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null) { parent::__construct($message, $code, $severity, $filename, $lineno); - if (null !== $traceOffset) { + if (null !== $trace) { + if (!$traceArgs) { + foreach ($trace as &$frame) { + unset($frame['args'], $frame['this'], $frame); + } + } + + $this->setTrace($trace); + } elseif (null !== $traceOffset) { if (function_exists('xdebug_get_function_stack')) { $trace = xdebug_get_function_stack(); if (0 < $traceOffset) { @@ -48,7 +56,7 @@ public function __construct($message, $code, $severity, $filename, $lineno, $tra foreach ($trace as &$frame) { if (!isset($frame['type'])) { - // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695 + // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695 if (isset($frame['class'])) { $frame['type'] = '::'; } diff --git a/core/vendor/symfony/debug/Exception/FatalBaseException.php b/core/vendor/symfony/debug/Exception/FatalThrowableError.php similarity index 79% rename from core/vendor/symfony/debug/Exception/FatalBaseException.php rename to core/vendor/symfony/debug/Exception/FatalThrowableError.php index 769d30ccb13d..6ff5ecdaffed 100644 --- a/core/vendor/symfony/debug/Exception/FatalBaseException.php +++ b/core/vendor/symfony/debug/Exception/FatalThrowableError.php @@ -12,18 +12,18 @@ namespace Symfony\Component\Debug\Exception; /** - * Base Fatal Error Exception. + * Fatal Throwable Error. * * @author Nicolas Grekas <p@tchwork.com> */ -class FatalBaseException extends FatalErrorException +class FatalThrowableError extends FatalErrorException { - public function __construct(\BaseException $e) + public function __construct(\Throwable $e) { - if ($e instanceof \ParseException) { + if ($e instanceof \ParseError) { $message = 'Parse error: '.$e->getMessage(); $severity = E_PARSE; - } elseif ($e instanceof \TypeException) { + } elseif ($e instanceof \TypeError) { $message = 'Type error: '.$e->getMessage(); $severity = E_RECOVERABLE_ERROR; } else { diff --git a/core/vendor/symfony/debug/Tests/DebugClassLoaderTest.php b/core/vendor/symfony/debug/Tests/DebugClassLoaderTest.php index 46953290d872..a368a7d25704 100644 --- a/core/vendor/symfony/debug/Tests/DebugClassLoaderTest.php +++ b/core/vendor/symfony/debug/Tests/DebugClassLoaderTest.php @@ -64,6 +64,9 @@ public function testUnsilencing() if (PHP_VERSION_ID >= 70000) { $this->markTestSkipped('PHP7 throws exceptions, unsilencing is not required anymore.'); } + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('HHVM is not handled in this test case.'); + } ob_start(); @@ -86,6 +89,9 @@ public function testStacking() if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) { $this->markTestSkipped('The ContextErrorException class is already loaded.'); } + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('HHVM is not handled in this test case.'); + } ErrorHandler::register(); @@ -106,10 +112,10 @@ class ChildTestingStacking extends TestingStacking { function foo($bar) {} } restore_exception_handler(); $this->assertStringStartsWith(__FILE__, $exception->getFile()); if (PHP_VERSION_ID < 70000) { - $this->assertRegexp('/^Runtime Notice: Declaration/', $exception->getMessage()); + $this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage()); $this->assertEquals(E_STRICT, $exception->getSeverity()); } else { - $this->assertRegexp('/^Warning: Declaration/', $exception->getMessage()); + $this->assertRegExp('/^Warning: Declaration/', $exception->getMessage()); $this->assertEquals(E_WARNING, $exception->getSeverity()); } } catch (\Exception $exception) { @@ -130,6 +136,7 @@ class_exists(__NAMESPACE__.'\TestingCaseMismatch', true); /** * @expectedException \RuntimeException + * @expectedExceptionMessage Case mismatch between class and source file names */ public function testFileCaseMismatch() { @@ -258,6 +265,8 @@ public function getClassMap() public function findFile($class) { + $fixtureDir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR; + if (__NAMESPACE__.'\TestingUnsilencing' === $class) { eval('-- parse error --'); } elseif (__NAMESPACE__.'\TestingStacking' === $class) { @@ -265,15 +274,15 @@ public function findFile($class) } elseif (__NAMESPACE__.'\TestingCaseMismatch' === $class) { eval('namespace '.__NAMESPACE__.'; class TestingCaseMisMatch {}'); } elseif (__NAMESPACE__.'\Fixtures\CaseMismatch' === $class) { - return __DIR__.'/Fixtures/CaseMismatch.php'; + return $fixtureDir.'CaseMismatch.php'; } elseif (__NAMESPACE__.'\Fixtures\Psr4CaseMismatch' === $class) { - return __DIR__.'/Fixtures/psr4/Psr4CaseMismatch.php'; + return $fixtureDir.'psr4'.DIRECTORY_SEPARATOR.'Psr4CaseMismatch.php'; } elseif (__NAMESPACE__.'\Fixtures\NotPSR0' === $class) { - return __DIR__.'/Fixtures/reallyNotPsr0.php'; + return $fixtureDir.'reallyNotPsr0.php'; } elseif (__NAMESPACE__.'\Fixtures\NotPSR0bis' === $class) { - return __DIR__.'/Fixtures/notPsr0Bis.php'; + return $fixtureDir.'notPsr0Bis.php'; } elseif (__NAMESPACE__.'\Fixtures\DeprecatedInterface' === $class) { - return __DIR__.'/Fixtures/DeprecatedInterface.php'; + return $fixtureDir.'DeprecatedInterface.php'; } elseif ('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent' === $class) { eval('namespace Symfony\Bridge\Debug\Tests\Fixtures; class ExtendsDeprecatedParent extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}'); } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedParentClass' === $class) { diff --git a/core/vendor/symfony/debug/Tests/ErrorHandlerTest.php b/core/vendor/symfony/debug/Tests/ErrorHandlerTest.php index 8b2d0bce215d..5d521a143478 100644 --- a/core/vendor/symfony/debug/Tests/ErrorHandlerTest.php +++ b/core/vendor/symfony/debug/Tests/ErrorHandlerTest.php @@ -77,7 +77,7 @@ public function testNotice() $this->assertEquals(E_NOTICE, $exception->getSeverity()); $this->assertEquals(__FILE__, $exception->getFile()); - $this->assertRegexp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage()); + $this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage()); $this->assertArrayHasKey('foobar', $exception->getContext()); $trace = $exception->getTrace(); @@ -169,8 +169,6 @@ public function testDefaultLogger() public function testHandleError() { - $this->iniSet('error_reporting', -1); - try { $handler = ErrorHandler::register(); $handler->throwAt(0, true); @@ -318,6 +316,40 @@ public function testHandleException() } } + public function testErrorStacking() + { + try { + $handler = ErrorHandler::register(); + $handler->screamAt(E_USER_WARNING); + + $logger = $this->getMock('Psr\Log\LoggerInterface'); + + $logger + ->expects($this->exactly(2)) + ->method('log') + ->withConsecutive( + array($this->equalTo(LogLevel::WARNING), $this->equalTo('Dummy log')), + array($this->equalTo(LogLevel::DEBUG), $this->equalTo('Silenced warning')) + ) + ; + + $handler->setDefaultLogger($logger, array(E_USER_WARNING => LogLevel::WARNING)); + + ErrorHandler::stackErrors(); + @trigger_error('Silenced warning', E_USER_WARNING); + $logger->log(LogLevel::WARNING, 'Dummy log'); + ErrorHandler::unstackErrors(); + + restore_error_handler(); + restore_exception_handler(); + } catch (\Exception $e) { + restore_error_handler(); + restore_exception_handler(); + + throw $e; + } + } + public function testHandleFatalError() { try { @@ -359,13 +391,57 @@ public function testHandleFatalError() } } + public function testHandleFatalErrorOnHHVM() + { + try { + $handler = ErrorHandler::register(); + + $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger + ->expects($this->once()) + ->method('log') + ->with( + $this->equalTo(LogLevel::CRITICAL), + $this->equalTo('Fatal Error: foo'), + $this->equalTo(array( + 'type' => 1, + 'file' => 'bar', + 'line' => 123, + 'level' => -1, + 'stack' => array(456), + )) + ) + ; + + $handler->setDefaultLogger($logger, E_ERROR); + + $error = array( + 'type' => E_ERROR + 0x1000000, // This error level is used by HHVM for fatal errors + 'message' => 'foo', + 'file' => 'bar', + 'line' => 123, + 'context' => array(123), + 'backtrace' => array(456), + ); + + call_user_func_array(array($handler, 'handleError'), $error); + $handler->handleFatalError($error); + + restore_error_handler(); + restore_exception_handler(); + } catch (\Exception $e) { + restore_error_handler(); + restore_exception_handler(); + + throw $e; + } + } + /** * @group legacy */ public function testLegacyInterface() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - try { $handler = ErrorHandler::register(0); $this->assertFalse($handler->handle(0, 'foo', 'foo.php', 12, array())); diff --git a/core/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/core/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php index 6ac3374d8e2c..c93983721f6c 100644 --- a/core/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php +++ b/core/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php @@ -61,7 +61,7 @@ public function testHandleClassNotFound($error, $translatedMessage, $autoloader array_map('spl_autoload_register', $autoloaders); } - $this->assertInstanceof('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); + $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); $this->assertSame($translatedMessage, $exception->getMessage()); $this->assertSame($error['type'], $exception->getSeverity()); $this->assertSame($error['file'], $exception->getFile()); @@ -73,8 +73,6 @@ public function testHandleClassNotFound($error, $translatedMessage, $autoloader */ public function testLegacyHandleClassNotFound() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader(); $symfonyUniversalClassLoader->registerPrefixes($prefixes); @@ -197,6 +195,6 @@ public function testCannotRedeclareClass() $handler = new ClassNotFoundFatalErrorHandler(); $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - $this->assertInstanceof('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); + $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception); } } diff --git a/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php b/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php index ffe9edb062f5..795b74781c23 100644 --- a/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php +++ b/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php @@ -24,7 +24,7 @@ public function testUndefinedFunction($error, $translatedMessage) $handler = new UndefinedFunctionFatalErrorHandler(); $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - $this->assertInstanceof('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception); + $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception); // class names are case insensitive and PHP/HHVM do not return the same $this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage())); $this->assertSame($error['type'], $exception->getSeverity()); diff --git a/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php index 5d1ff238024a..de7b21c69978 100644 --- a/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php +++ b/core/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php @@ -24,7 +24,7 @@ public function testUndefinedMethod($error, $translatedMessage) $handler = new UndefinedMethodFatalErrorHandler(); $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line'])); - $this->assertInstanceof('Symfony\Component\Debug\Exception\UndefinedMethodException', $exception); + $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedMethodException', $exception); $this->assertSame($translatedMessage, $exception->getMessage()); $this->assertSame($error['type'], $exception->getSeverity()); $this->assertSame($error['file'], $exception->getFile()); diff --git a/core/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php b/core/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php index 0efc6b500b5d..3fc6a1102862 100644 --- a/core/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php +++ b/core/vendor/symfony/dependency-injection/Compiler/ResolveDefinitionTemplatesPass.php @@ -125,6 +125,14 @@ private function resolveDefinition($id, DefinitionDecorator $definition) if (isset($changes['lazy'])) { $def->setLazy($definition->isLazy()); } + if (isset($changes['decorated_service'])) { + $decoratedService = $definition->getDecoratedService(); + if (null === $decoratedService) { + $def->setDecoratedService($decoratedService); + } else { + $def->setDecoratedService($decoratedService[0], $decoratedService[1]); + } + } // merge arguments foreach ($definition->getArguments() as $k => $v) { diff --git a/core/vendor/symfony/dependency-injection/Compiler/ResolveInvalidReferencesPass.php b/core/vendor/symfony/dependency-injection/Compiler/ResolveInvalidReferencesPass.php index 000bf087001c..85dbceb9a61e 100644 --- a/core/vendor/symfony/dependency-injection/Compiler/ResolveInvalidReferencesPass.php +++ b/core/vendor/symfony/dependency-injection/Compiler/ResolveInvalidReferencesPass.php @@ -47,7 +47,7 @@ public function process(ContainerBuilder $container) foreach ($definition->getMethodCalls() as $call) { try { $calls[] = array($call[0], $this->processArguments($call[1], true)); - } catch (RuntimeException $ignore) { + } catch (RuntimeException $e) { // this call is simply removed } } @@ -58,7 +58,7 @@ public function process(ContainerBuilder $container) try { $value = $this->processArguments(array($value), true); $properties[$name] = reset($value); - } catch (RuntimeException $ignore) { + } catch (RuntimeException $e) { // ignore property } } diff --git a/core/vendor/symfony/dependency-injection/Compiler/ResolveParameterPlaceHoldersPass.php b/core/vendor/symfony/dependency-injection/Compiler/ResolveParameterPlaceHoldersPass.php index 0a789676c96f..a35f84cbe4a8 100644 --- a/core/vendor/symfony/dependency-injection/Compiler/ResolveParameterPlaceHoldersPass.php +++ b/core/vendor/symfony/dependency-injection/Compiler/ResolveParameterPlaceHoldersPass.php @@ -38,7 +38,7 @@ public function process(ContainerBuilder $container) $definition->setFile($parameterBag->resolveValue($definition->getFile())); $definition->setArguments($parameterBag->resolveValue($definition->getArguments())); if ($definition->getFactoryClass(false)) { - $definition->setFactoryClass($parameterBag->resolveValue($definition->getFactoryClass())); + $definition->setFactoryClass($parameterBag->resolveValue($definition->getFactoryClass(false))); } $factory = $definition->getFactory(); diff --git a/core/vendor/symfony/dependency-injection/DefinitionDecorator.php b/core/vendor/symfony/dependency-injection/DefinitionDecorator.php index d4b45d34ad31..f5a1485a5f33 100644 --- a/core/vendor/symfony/dependency-injection/DefinitionDecorator.php +++ b/core/vendor/symfony/dependency-injection/DefinitionDecorator.php @@ -170,6 +170,16 @@ public function setLazy($boolean) return parent::setLazy($boolean); } + /** + * {@inheritdoc} + */ + public function setDecoratedService($id, $renamedId = null) + { + $this->changes['decorated_service'] = true; + + return parent::setDecoratedService($id, $renamedId); + } + /** * Gets an argument to pass to the service constructor/factory method. * diff --git a/core/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php b/core/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php index 5eba090a2e4d..5f35a1e5bb11 100644 --- a/core/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php +++ b/core/vendor/symfony/dependency-injection/Dumper/GraphvizDumper.php @@ -278,7 +278,7 @@ private function addOptions($options) */ private function dotize($id) { - return strtolower(preg_replace('/[^\w]/i', '_', $id)); + return strtolower(preg_replace('/\W/i', '_', $id)); } /** diff --git a/core/vendor/symfony/dependency-injection/Dumper/PhpDumper.php b/core/vendor/symfony/dependency-injection/Dumper/PhpDumper.php index 9c2b6dd54d3c..c59bc8d5b129 100644 --- a/core/vendor/symfony/dependency-injection/Dumper/PhpDumper.php +++ b/core/vendor/symfony/dependency-injection/Dumper/PhpDumper.php @@ -862,8 +862,8 @@ public function __construct() if (count($scopes = $this->container->getScopes()) > 0) { $code .= "\n"; - $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; - $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + $code .= ' $this->scopes = '.$this->dumpValue($scopes).";\n"; + $code .= ' $this->scopeChildren = '.$this->dumpValue($this->container->getScopeChildren()).";\n"; } $code .= $this->addMethodMap(); @@ -908,8 +908,8 @@ public function __construct() $code .= "\n"; if (count($scopes = $this->container->getScopes()) > 0) { - $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; - $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + $code .= ' $this->scopes = '.$this->dumpValue($scopes).";\n"; + $code .= ' $this->scopeChildren = '.$this->dumpValue($this->container->getScopeChildren()).";\n"; } else { $code .= " \$this->scopes = array();\n"; $code .= " \$this->scopeChildren = array();\n"; @@ -1301,11 +1301,6 @@ private function dumpValue($value, $interpolate = true) foreach ($value->getArguments() as $argument) { $arguments[] = $this->dumpValue($argument); } - $class = $this->dumpValue($value->getClass()); - - if (false !== strpos($class, '$')) { - throw new RuntimeException('Cannot dump definitions which have a variable class name.'); - } if (null !== $value->getFactory()) { $factory = $value->getFactory(); @@ -1343,6 +1338,15 @@ private function dumpValue($value, $interpolate = true) } } + $class = $value->getClass(); + if (null === $class) { + throw new RuntimeException('Cannot dump definitions which have no class nor factory.'); + } + $class = $this->dumpValue($class); + if (false !== strpos($class, '$')) { + throw new RuntimeException('Cannot dump definitions which have a variable class name.'); + } + return sprintf('new \\%s(%s)', substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); } elseif ($value instanceof Variable) { return '$'.$value; diff --git a/core/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php b/core/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php index 523c01cea493..887f536e458e 100644 --- a/core/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php +++ b/core/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php @@ -151,7 +151,7 @@ private function parseDefinition(\DOMElement $service, $file) foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract') as $key) { if ($value = $service->getAttribute($key)) { if (in_array($key, array('factory-class', 'factory-method', 'factory-service'))) { - @trigger_error(sprintf('The "%s" attribute in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s" attribute of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED); } $method = 'set'.str_replace('-', '', $key); $definition->$method(XmlUtils::phpize($value)); @@ -162,7 +162,7 @@ private function parseDefinition(\DOMElement $service, $file) $triggerDeprecation = 'request' !== (string) $service->getAttribute('id'); if ($triggerDeprecation) { - @trigger_error(sprintf('The "synchronized" attribute in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "synchronized" attribute of service "%s" in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', (string) $service->getAttribute('id'), $file), E_USER_DEPRECATED); } $definition->setSynchronized(XmlUtils::phpize($value), $triggerDeprecation); diff --git a/core/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php b/core/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php index e10cfe2a4bce..be2d3f130081 100644 --- a/core/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php +++ b/core/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php @@ -172,7 +172,7 @@ private function parseDefinition($id, $service, $file) } if (isset($service['synchronized'])) { - @trigger_error(sprintf('The "synchronized" key in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "synchronized" key of service "%s" in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $id, $file), E_USER_DEPRECATED); $definition->setSynchronized($service['synchronized'], 'request' !== $id); } @@ -202,17 +202,17 @@ private function parseDefinition($id, $service, $file) } if (isset($service['factory_class'])) { - @trigger_error(sprintf('The "factory_class" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "factory_class" key of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $id, $file), E_USER_DEPRECATED); $definition->setFactoryClass($service['factory_class']); } if (isset($service['factory_method'])) { - @trigger_error(sprintf('The "factory_method" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "factory_method" key of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $id, $file), E_USER_DEPRECATED); $definition->setFactoryMethod($service['factory_method']); } if (isset($service['factory_service'])) { - @trigger_error(sprintf('The "factory_service" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED); + @trigger_error(sprintf('The "factory_service" key of service "%s" in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $id, $file), E_USER_DEPRECATED); $definition->setFactoryService($service['factory_service']); } diff --git a/core/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php b/core/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php index dc936a0bd671..3ea6d9636ba2 100644 --- a/core/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php +++ b/core/vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php @@ -69,4 +69,14 @@ public function set($name, $value) { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } + + /** + * {@inheritdoc} + * + * @api + */ + public function remove($name) + { + throw new LogicException('Impossible to call remove() on a frozen ParameterBag.'); + } } diff --git a/core/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/core/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php index 09ae3c413a75..4e8efdc8b4fa 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Compiler/CheckDefinitionValidityPassTest.php @@ -56,8 +56,6 @@ public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass( */ public function testLegacyProcessDetectsBothFactorySyntaxesUsed() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = new ContainerBuilder(); $container->register('a')->setFactory(array('a', 'b'))->setFactoryClass('a'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php b/core/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php index 148a30b6c275..e730a1a288a8 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Compiler/LegacyResolveParameterPlaceHoldersPassTest.php @@ -21,8 +21,6 @@ class LegacyResolveParameterPlaceHoldersPassTest extends \PHPUnit_Framework_Test { public function testFactoryClassParametersShouldBeResolved() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $compilerPass = new ResolveParameterPlaceHoldersPass(); $container = new ContainerBuilder(); diff --git a/core/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php b/core/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php index fb2bb5fca305..845edd2c1419 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php @@ -117,6 +117,25 @@ public function testProcessDoesNotCopyTags() $this->assertEquals(array(), $def->getTags()); } + public function testProcessDoesNotCopyDecoratedService() + { + $container = new ContainerBuilder(); + + $container + ->register('parent') + ->setDecoratedService('foo') + ; + + $container + ->setDefinition('child', new DefinitionDecorator('parent')) + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertNull($def->getDecoratedService()); + } + public function testProcessHandlesMultipleInheritance() { $container = new ContainerBuilder(); @@ -173,6 +192,21 @@ public function testSetLazyOnServiceIsParent() $this->assertTrue($container->getDefinition('child1')->isLazy()); } + public function testSetDecoratedServiceOnServiceHasParent() + { + $container = new ContainerBuilder(); + + $container->register('parent', 'stdClass'); + + $container->setDefinition('child1', new DefinitionDecorator('parent')) + ->setDecoratedService('foo', 'foo_inner') + ; + + $this->process($container); + + $this->assertEquals(array('foo', 'foo_inner'), $container->getDefinition('child1')->getDecoratedService()); + } + protected function process(ContainerBuilder $container) { $pass = new ResolveDefinitionTemplatesPass(); diff --git a/core/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php b/core/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php index 1e3f10340596..8155e0b7c6b8 100644 --- a/core/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php @@ -342,8 +342,6 @@ public function testCreateServiceFactory() public function testLegacyCreateServiceFactory() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $builder = new ContainerBuilder(); $builder->register('bar', 'Bar\FooClass'); $builder @@ -363,8 +361,6 @@ public function testLegacyCreateServiceFactory() */ public function testLegacyCreateServiceFactoryService() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $builder = new ContainerBuilder(); $builder->register('foo_service', 'Bar\FooClass'); $builder @@ -735,8 +731,6 @@ public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer() */ public function testLegacySetOnSynchronizedService() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = new ContainerBuilder(); $container->register('baz', 'BazClass') ->setSynchronized(true) @@ -757,8 +751,6 @@ public function testLegacySetOnSynchronizedService() */ public function testLegacySynchronizedServiceWithScopes() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = new ContainerBuilder(); $container->addScope(new Scope('foo')); $container->register('baz', 'BazClass') diff --git a/core/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php b/core/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php index f9006540a561..732eead1407b 100644 --- a/core/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/DefinitionDecoratorTest.php @@ -55,8 +55,6 @@ public function getPropertyTests() */ public function testLegacySetProperty($property, $changeKey) { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $def = new DefinitionDecorator('foo'); $getter = 'get'.ucfirst($property); diff --git a/core/vendor/symfony/dependency-injection/Tests/DefinitionTest.php b/core/vendor/symfony/dependency-injection/Tests/DefinitionTest.php index b6539f3b7400..b501f1183901 100644 --- a/core/vendor/symfony/dependency-injection/Tests/DefinitionTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/DefinitionTest.php @@ -170,8 +170,6 @@ public function testSetIsSynthetic() */ public function testLegacySetIsSynchronized() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $def = new Definition('stdClass'); $this->assertFalse($def->isSynchronized(), '->isSynchronized() returns false by default'); $this->assertSame($def, $def->setSynchronized(true), '->setSynchronized() implements a fluent interface'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php b/core/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php index ba5e12cd5076..5da11359fa8b 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Dumper/GraphvizDumperTest.php @@ -28,8 +28,6 @@ public static function setUpBeforeClass() */ public function testLegacyDump() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; $dumper = new GraphvizDumper($container); $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/legacy-services9.dot')), $dumper->dump(), '->dump() dumps services'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php b/core/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php index 7fa0c17a13b7..063007e5d34e 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Dumper/PhpDumperTest.php @@ -129,8 +129,6 @@ public function testAddService() */ public function testLegacySynchronizedServices() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = include self::$fixturesPath.'/containers/container20.php'; $dumper = new PhpDumper($container); $this->assertEquals(str_replace('%path%', str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services20.php')), $dumper->dump(), '->dump() dumps services'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php b/core/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php index 9ee103630a12..8aa544c728f4 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Dumper/XmlDumperTest.php @@ -49,8 +49,6 @@ public function testAddParameters() */ public function testLegacyAddService() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; $dumper = new XmlDumper($container); diff --git a/core/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php b/core/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php index c22c7eb40e24..8e9f1174c250 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Dumper/YamlDumperTest.php @@ -45,8 +45,6 @@ public function testAddParameters() */ public function testLegacyAddService() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = include self::$fixturesPath.'/containers/legacy-container9.php'; $dumper = new YamlDumper($container); diff --git a/core/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php b/core/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php index cfe9425c5040..5fa06a0eb50e 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php +++ b/core/vendor/symfony/dependency-injection/Tests/Fixtures/includes/createphar.php @@ -44,4 +44,4 @@ public function getAlias() </xsd:schema> EOT ); -$phar->setStub('<?php require_once "phar://ProjectWithXsdExtensionInPhar.phar/ProjectWithXsdExtensionInPhar.php"; __HALT_COMPILER(); ?>'); +$phar->setStub('<?php Phar::mapPhar("ProjectWithXsdExtensionInPhar.phar"); require_once "phar://ProjectWithXsdExtensionInPhar.phar/ProjectWithXsdExtensionInPhar.php"; __HALT_COMPILER(); ?>'); diff --git a/core/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php b/core/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php index b8512a2610ea..40aec2006566 100644 --- a/core/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/LegacyContainerBuilderTest.php @@ -19,11 +19,6 @@ */ class LegacyContainerBuilderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - /** * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService */ diff --git a/core/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php b/core/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php index 437b77b31b05..b85d81f48153 100644 --- a/core/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/LegacyDefinitionTest.php @@ -18,11 +18,6 @@ */ class LegacyDefinitionTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - public function testSetGetFactoryClass() { $def = new Definition('stdClass'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php index 56f599b7cccc..8bf524ae4f32 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php @@ -195,8 +195,6 @@ public function testLoadAnonymousServices() */ public function testLegacyLoadServices() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = new ContainerBuilder(); $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); $loader->load('legacy-services6.xml'); diff --git a/core/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php index f329aace79d8..28cf0ebf6252 100644 --- a/core/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php +++ b/core/vendor/symfony/dependency-injection/Tests/Loader/YamlFileLoaderTest.php @@ -124,8 +124,6 @@ public function testLoadImports() */ public function testLegacyLoadServices() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $container = new ContainerBuilder(); $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); $loader->load('legacy-services6.yml'); diff --git a/core/vendor/symfony/dom-crawler/Tests/FormTest.php b/core/vendor/symfony/dom-crawler/Tests/FormTest.php index e2c190473890..59c3c76cf0f4 100644 --- a/core/vendor/symfony/dom-crawler/Tests/FormTest.php +++ b/core/vendor/symfony/dom-crawler/Tests/FormTest.php @@ -825,7 +825,6 @@ public function testFormRegistrySetValueOnCompoundField() */ public function testFormRegistrySetArrayOnNotCompoundField() { - $registry = new FormFieldRegistry(); $registry->add($this->getFormFieldMock('bar')); diff --git a/core/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php b/core/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php index 5ff5be84d153..f9c7e0e8bef3 100644 --- a/core/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php +++ b/core/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php @@ -126,8 +126,6 @@ public function testDispatch() */ public function testLegacyDispatch() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $event = new Event(); $return = $this->dispatcher->dispatch(self::preFoo, $event); $this->assertEquals('pre.foo', $event->getName()); @@ -255,8 +253,6 @@ public function testRemoveSubscriberWithMultipleListeners() */ public function testLegacyEventReceivesTheDispatcherInstance() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $dispatcher = null; $this->dispatcher->addListener('test', function ($event) use (&$dispatcher) { $dispatcher = $event->getDispatcher(); diff --git a/core/vendor/symfony/event-dispatcher/Tests/EventTest.php b/core/vendor/symfony/event-dispatcher/Tests/EventTest.php index 4bd2697220e0..9a822670cd5e 100644 --- a/core/vendor/symfony/event-dispatcher/Tests/EventTest.php +++ b/core/vendor/symfony/event-dispatcher/Tests/EventTest.php @@ -65,7 +65,6 @@ public function testStopPropagationAndIsPropagationStopped() */ public function testLegacySetDispatcher() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->event->setDispatcher($this->dispatcher); $this->assertSame($this->dispatcher, $this->event->getDispatcher()); } @@ -75,7 +74,6 @@ public function testLegacySetDispatcher() */ public function testLegacyGetDispatcher() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->assertNull($this->event->getDispatcher()); } @@ -84,7 +82,6 @@ public function testLegacyGetDispatcher() */ public function testLegacyGetName() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->assertNull($this->event->getName()); } @@ -93,7 +90,6 @@ public function testLegacyGetName() */ public function testLegacySetName() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->event->setName('foo'); $this->assertEquals('foo', $this->event->getName()); } diff --git a/core/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php b/core/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php index 81b2b02bd46f..ecc8a30ac25d 100644 --- a/core/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php +++ b/core/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php @@ -67,6 +67,14 @@ public static function getInstance() return self::$instance; } + /** + * Resets the singleton instance. + */ + public static function reset() + { + self::$instance = null; + } + /** * Registers all natively provided mime type guessers. */ diff --git a/core/vendor/symfony/http-foundation/JsonResponse.php b/core/vendor/symfony/http-foundation/JsonResponse.php index fa80c6885826..5399d1b1f160 100644 --- a/core/vendor/symfony/http-foundation/JsonResponse.php +++ b/core/vendor/symfony/http-foundation/JsonResponse.php @@ -26,7 +26,10 @@ class JsonResponse extends Response { protected $data; protected $callback; - protected $encodingOptions; + + // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. + // 15 === JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT + protected $encodingOptions = 15; /** * Constructor. @@ -43,9 +46,6 @@ public function __construct($data = null, $status = 200, $headers = array()) $data = new \ArrayObject(); } - // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. - $this->encodingOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT; - $this->setData($data); } @@ -95,34 +95,58 @@ public function setCallback($callback = null) */ public function setData($data = array()) { - $errorHandler = null; - $errorHandler = set_error_handler(function () use (&$errorHandler) { - if (JSON_ERROR_NONE !== json_last_error()) { - return; - } + if (defined('HHVM_VERSION')) { + // HHVM does not trigger any warnings and let exceptions + // thrown from a JsonSerializable object pass through. + // If only PHP did the same... + $data = json_encode($data, $this->encodingOptions); + } else { + try { + if (PHP_VERSION_ID < 50400) { + // PHP 5.3 triggers annoying warnings for some + // types that can't be serialized as JSON (INF, resources, etc.) + // but doesn't provide the JsonSerializable interface. + set_error_handler('var_dump', 0); + $data = @json_encode($data, $this->encodingOptions); + } else { + // PHP 5.4 and up wrap exceptions thrown by JsonSerializable + // objects in a new exception that needs to be removed. + // Fortunately, PHP 5.5 and up do not trigger any warning anymore. + if (PHP_VERSION_ID < 50500) { + // Clear json_last_error() + json_encode(null); + $errorHandler = set_error_handler('var_dump'); + restore_error_handler(); + set_error_handler(function () use ($errorHandler) { + if (JSON_ERROR_NONE === json_last_error()) { + return $errorHandler && false !== call_user_func_array($errorHandler, func_get_args()); + } + }); + } + + $data = json_encode($data, $this->encodingOptions); + } - if ($errorHandler) { - call_user_func_array($errorHandler, func_get_args()); + if (PHP_VERSION_ID < 50500) { + restore_error_handler(); + } + } catch (\Exception $e) { + if (PHP_VERSION_ID < 50500) { + restore_error_handler(); + } + if (PHP_VERSION_ID >= 50400 && 'Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) { + throw $e->getPrevious() ?: $e; + } + throw $e; } - }); - - try { - // Clear json_last_error() - json_encode(null); - - $this->data = json_encode($data, $this->encodingOptions); - - restore_error_handler(); - } catch (\Exception $exception) { - restore_error_handler(); - - throw $exception; } if (JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException($this->transformJsonError()); } + $this->data = $data; + return $this->update(); } diff --git a/core/vendor/symfony/http-foundation/Request.php b/core/vendor/symfony/http-foundation/Request.php index c2b7640468c2..7c4afb03bdee 100644 --- a/core/vendor/symfony/http-foundation/Request.php +++ b/core/vendor/symfony/http-foundation/Request.php @@ -517,10 +517,16 @@ public function __clone() */ public function __toString() { + try { + $content = $this->getContent(); + } catch (\LogicException $e) { + return trigger_error($e, E_USER_ERROR); + } + return sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". $this->headers."\r\n". - $this->getContent(); + $content; } /** diff --git a/core/vendor/symfony/http-foundation/Response.php b/core/vendor/symfony/http-foundation/Response.php index 6641e5102359..dc7203a8d1c8 100644 --- a/core/vendor/symfony/http-foundation/Response.php +++ b/core/vendor/symfony/http-foundation/Response.php @@ -1242,15 +1242,9 @@ public static function closeOutputBuffers($targetLevel, $flush) { $status = ob_get_status(true); $level = count($status); + $flags = PHP_VERSION_ID >= 50400 ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1; - while ($level-- > $targetLevel - && (!empty($status[$level]['del']) - || (isset($status[$level]['flags']) - && ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE) - && ($status[$level]['flags'] & ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE)) - ) - ) - ) { + while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) { if ($flush) { ob_end_flush(); } else { diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php index 32b73968db68..48e81ee0f1d3 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -126,7 +126,7 @@ class PdoSessionHandler implements \SessionHandlerInterface private $lockMode = self::LOCK_TRANSACTIONAL; /** - * It's an array to support multiple reads before closing which is manual, non-standard usage + * It's an array to support multiple reads before closing which is manual, non-standard usage. * * @var \PDOStatement[] An array of statements to release advisory locks */ @@ -483,7 +483,7 @@ private function rollback() if ('sqlite' === $this->driver) { $this->pdo->exec('ROLLBACK'); } else { - $this->pdo->rollback(); + $this->pdo->rollBack(); } $this->inTransaction = false; } @@ -680,7 +680,7 @@ private function getMergeSql() } /** - * Return a PDO instance + * Return a PDO instance. * * @return \PDO */ diff --git a/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php index f3eeb084e20f..bc1373755ad5 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -249,7 +249,7 @@ public function getMetadataBag() */ protected function generateId() { - return hash('sha256', uniqid(mt_rand())); + return hash('sha256', uniqid('ss_mock_', true)); } protected function loadSession() diff --git a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php index a5bdbe91d8f0..db705db87c48 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -203,7 +203,13 @@ public function regenerate($destroy = false, $lifetime = null) $this->metadataBag->stampNew(); } - return session_regenerate_id($destroy); + $isRegenerated = session_regenerate_id($destroy); + + // The reference to $_SESSION in session bags is lost in PHP7 and we need to re-create it. + // @see https://bugs.php.net/bug.php?id=70013 + $this->loadSession(); + + return $isRegenerated; } /** diff --git a/core/vendor/symfony/http-foundation/Tests/ClockMock.php b/core/vendor/symfony/http-foundation/Tests/ClockMock.php new file mode 100644 index 000000000000..04a842d9b505 --- /dev/null +++ b/core/vendor/symfony/http-foundation/Tests/ClockMock.php @@ -0,0 +1,24 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +function time($asFloat = false) +{ + return Tests\time(); +} + +namespace Symfony\Component\HttpFoundation\Tests; + +function time() +{ + return $_SERVER['REQUEST_TIME']; +} diff --git a/core/vendor/symfony/http-foundation/Tests/CookieTest.php b/core/vendor/symfony/http-foundation/Tests/CookieTest.php index 0aaeb6baa177..b8474db15fa0 100644 --- a/core/vendor/symfony/http-foundation/Tests/CookieTest.php +++ b/core/vendor/symfony/http-foundation/Tests/CookieTest.php @@ -13,6 +13,8 @@ use Symfony\Component\HttpFoundation\Cookie; +require_once __DIR__.'/ClockMock.php'; + /** * CookieTest. * diff --git a/core/vendor/symfony/http-foundation/Tests/File/FileTest.php b/core/vendor/symfony/http-foundation/Tests/File/FileTest.php index 9e07d9e14bb2..6777849c8ac3 100644 --- a/core/vendor/symfony/http-foundation/Tests/File/FileTest.php +++ b/core/vendor/symfony/http-foundation/Tests/File/FileTest.php @@ -45,6 +45,19 @@ public function testGuessExtensionIsBasedOnMimeType() $this->assertEquals('gif', $file->guessExtension()); } + public function testGuessExtensionWithReset() + { + $file = new File(__DIR__.'/Fixtures/other-file.example'); + $guesser = $this->createMockGuesser($file->getPathname(), 'image/gif'); + MimeTypeGuesser::getInstance()->register($guesser); + + $this->assertEquals('gif', $file->guessExtension()); + + MimeTypeGuesser::reset(); + + $this->assertNull($file->guessExtension()); + } + public function testConstructWhenFileNotExists() { $this->setExpectedException('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException'); diff --git a/core/vendor/symfony/http-foundation/Tests/File/Fixtures/other-file.example b/core/vendor/symfony/http-foundation/Tests/File/Fixtures/other-file.example new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/core/vendor/symfony/http-foundation/Tests/JsonResponseTest.php b/core/vendor/symfony/http-foundation/Tests/JsonResponseTest.php index 48b86038a7e1..f1ea565700df 100644 --- a/core/vendor/symfony/http-foundation/Tests/JsonResponseTest.php +++ b/core/vendor/symfony/http-foundation/Tests/JsonResponseTest.php @@ -203,9 +203,8 @@ public function testSetContent() } /** - * @expectedException Exception - * @expectedExceptionMessage Failed calling Symfony\Component\HttpFoundation\Tests\JsonSerializableObject::jsonSerialize() - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php#114688 + * @expectedException \Exception + * @expectedExceptionMessage This error is expected */ public function testSetContentJsonSerializeError() { @@ -224,9 +223,7 @@ class JsonSerializableObject implements \JsonSerializable { public function jsonSerialize() { - trigger_error('This error is expected', E_USER_WARNING); - - return array(); + throw new \Exception('This error is expected'); } } } diff --git a/core/vendor/symfony/http-foundation/Tests/RequestTest.php b/core/vendor/symfony/http-foundation/Tests/RequestTest.php index 188aaf582bcf..45574df4c46b 100644 --- a/core/vendor/symfony/http-foundation/Tests/RequestTest.php +++ b/core/vendor/symfony/http-foundation/Tests/RequestTest.php @@ -985,7 +985,6 @@ public function testGetContentCantBeCalledTwiceWithResources($first, $second) } /** - * * @dataProvider getContentCantBeCalledTwiceWithResourcesProvider */ public function testGetContentCanBeCalledTwiceWithResources($first, $second) diff --git a/core/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php b/core/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php index ec739b592ba9..0fa198e09870 100644 --- a/core/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php +++ b/core/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php @@ -14,6 +14,8 @@ use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\Cookie; +require_once __DIR__.'/ClockMock.php'; + class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase { /** @@ -118,7 +120,7 @@ public function testToStringIncludesCookieHeaders() $bag->clearCookie('foo'); - $this->assertContains('Set-Cookie: foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; path=/; httponly', explode("\r\n", $bag->__toString())); + $this->assertRegExp('#^Set-Cookie: foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; path=/; httponly#m', $bag->__toString()); } public function testClearCookieSecureNotHttpOnly() @@ -127,7 +129,7 @@ public function testClearCookieSecureNotHttpOnly() $bag->clearCookie('foo', '/', null, true, false); - $this->assertContains("Set-Cookie: foo=deleted; expires=".gmdate("D, d-M-Y H:i:s T", time() - 31536001)."; path=/; secure", explode("\r\n", $bag->__toString())); + $this->assertRegExp('#^Set-Cookie: foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; path=/; secure#m', $bag->__toString()); } public function testReplace() diff --git a/core/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php b/core/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php index 25e963a7eb0f..44ad61b5e722 100644 --- a/core/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php +++ b/core/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php @@ -138,8 +138,6 @@ public function testPeekAll() */ public function testLegacyGetIterator() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $flashes = array('hello' => 'world', 'beep' => 'boop', 'notice' => 'nope'); foreach ($flashes as $key => $val) { $this->bag->set($key, $val); diff --git a/core/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php b/core/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php index 92f890152d23..7a1e491dc155 100644 --- a/core/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php +++ b/core/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php @@ -22,8 +22,6 @@ class LegacyPdoSessionHandlerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { $this->markTestSkipped('This test requires SQLite support in your environment'); } diff --git a/core/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php b/core/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php index e2146d8434c5..c8743aba943e 100644 --- a/core/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/core/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -119,6 +119,17 @@ public function testRegenerateDestroy() $this->assertEquals(11, $storage->getBag('attributes')->get('legs')); } + public function testSessionGlobalIsUpToDateAfterIdRegeneration() + { + $storage = $this->getStorage(); + $storage->start(); + $storage->getBag('attributes')->set('lucky', 7); + $storage->regenerate(); + $storage->getBag('attributes')->set('lucky', 42); + + $this->assertEquals(42, $_SESSION['_sf2_attributes']['lucky']); + } + public function testDefaultSessionCacheLimiter() { $this->iniSet('session.cache_limiter', 'nocache'); @@ -216,7 +227,6 @@ public function testStartedOutside() { $storage = $this->getStorage(); - $this->assertFalse(isset($_SESSION)); $this->assertFalse($storage->getSaveHandler()->isActive()); $this->assertFalse($storage->isStarted()); diff --git a/core/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/core/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php index 0acc4458cc22..07d560f711b3 100644 --- a/core/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php +++ b/core/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php @@ -91,7 +91,6 @@ public function testPhpSession54() $storage = $this->getStorage(); - $this->assertFalse(isset($_SESSION)); $this->assertFalse($storage->getSaveHandler()->isActive()); $this->assertFalse($storage->isStarted()); diff --git a/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php index 0f06f87ca98c..9a499a737ad0 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php @@ -132,7 +132,7 @@ public function collect(Request $request, Response $response, \Exception $except 'file' => $r->getFileName(), 'line' => $r->getStartLine(), ); - } catch (\ReflectionException $re) { + } catch (\ReflectionException $e) { if (is_callable($controller)) { // using __call or __callStatic $this->data['controller'] = array( diff --git a/core/vendor/symfony/http-kernel/HttpCache/Esi.php b/core/vendor/symfony/http-kernel/HttpCache/Esi.php index adb7ff392512..e4e0a4be6f1a 100644 --- a/core/vendor/symfony/http-kernel/HttpCache/Esi.php +++ b/core/vendor/symfony/http-kernel/HttpCache/Esi.php @@ -234,7 +234,7 @@ public function process(Request $request, Response $response) $chunks[$i] = sprintf('<?php echo $this->surrogate->handle($this, %s, %s, %s) ?>'."\n", var_export($options['src'], true), var_export(isset($options['alt']) ? $options['alt'] : '', true), - isset($options['onerror']) && 'continue' == $options['onerror'] ? 'true' : 'false' + isset($options['onerror']) && 'continue' === $options['onerror'] ? 'true' : 'false' ); ++$i; $chunks[$i] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[$i]); diff --git a/core/vendor/symfony/http-kernel/Kernel.php b/core/vendor/symfony/http-kernel/Kernel.php index 25e5d3b26850..73c4b8b419fd 100644 --- a/core/vendor/symfony/http-kernel/Kernel.php +++ b/core/vendor/symfony/http-kernel/Kernel.php @@ -60,11 +60,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.1'; - const VERSION_ID = '20701'; + const VERSION = '2.7.2'; + const VERSION_ID = '20702'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '7'; - const RELEASE_VERSION = '1'; + const RELEASE_VERSION = '2'; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '05/2018'; diff --git a/core/vendor/symfony/http-kernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php b/core/vendor/symfony/http-kernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php index d64cf68a4190..c32f5bb01a4f 100644 --- a/core/vendor/symfony/http-kernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php +++ b/core/vendor/symfony/http-kernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php @@ -103,10 +103,10 @@ public function testHandleRestoresThePreviousRequestOnException($type) try { $kernel->handle($request, $type); $this->fail('->handle() suppresses the controller exception'); - } catch (\PHPUnit_Framework_Exception $exception) { - throw $exception; - } catch (\Exception $actual) { - $this->assertSame($expected, $actual, '->handle() throws the controller exception'); + } catch (\PHPUnit_Framework_Exception $e) { + throw $e; + } catch (\Exception $e) { + $this->assertSame($expected, $e, '->handle() throws the controller exception'); } } diff --git a/core/vendor/symfony/http-kernel/Tests/DependencyInjection/FragmentRendererPassTest.php b/core/vendor/symfony/http-kernel/Tests/DependencyInjection/FragmentRendererPassTest.php index a46a07cf1d98..3e2bfd072aaa 100644 --- a/core/vendor/symfony/http-kernel/Tests/DependencyInjection/FragmentRendererPassTest.php +++ b/core/vendor/symfony/http-kernel/Tests/DependencyInjection/FragmentRendererPassTest.php @@ -23,8 +23,6 @@ class FragmentRendererPassTest extends \PHPUnit_Framework_TestCase */ public function testLegacyFragmentRedererWithoutAlias() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - // no alias $services = array( 'my_content_renderer' => array(array()), diff --git a/core/vendor/symfony/http-kernel/Tests/EventListener/FragmentListenerTest.php b/core/vendor/symfony/http-kernel/Tests/EventListener/FragmentListenerTest.php index 18edee6123c7..fd5d63b16756 100644 --- a/core/vendor/symfony/http-kernel/Tests/EventListener/FragmentListenerTest.php +++ b/core/vendor/symfony/http-kernel/Tests/EventListener/FragmentListenerTest.php @@ -34,7 +34,6 @@ public function testOnlyTriggeredOnFragmentRoute() $this->assertTrue($request->query->has('_path')); } - public function testOnlyTriggeredIfControllerWasNotDefinedYet() { $request = Request::create('http://example.com/_fragment?_path=foo%3Dbar%26_controller%3Dfoo'); diff --git a/core/vendor/symfony/http-kernel/Tests/EventListener/ProfilerListenerTest.php b/core/vendor/symfony/http-kernel/Tests/EventListener/ProfilerListenerTest.php index 605ea9dd24ce..84ff0d6f50bc 100644 --- a/core/vendor/symfony/http-kernel/Tests/EventListener/ProfilerListenerTest.php +++ b/core/vendor/symfony/http-kernel/Tests/EventListener/ProfilerListenerTest.php @@ -29,8 +29,6 @@ class ProfilerListenerTest extends \PHPUnit_Framework_TestCase */ public function testLegacyEventsWithoutRequestStack() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile') ->disableOriginalConstructor() ->getMock(); diff --git a/core/vendor/symfony/http-kernel/Tests/KernelTest.php b/core/vendor/symfony/http-kernel/Tests/KernelTest.php index 2b75ba222f4f..c9e00dd68ea7 100644 --- a/core/vendor/symfony/http-kernel/Tests/KernelTest.php +++ b/core/vendor/symfony/http-kernel/Tests/KernelTest.php @@ -344,8 +344,6 @@ public function testLegacyIsClassInActiveBundleTrue() protected function getKernelMockForIsClassInActiveBundleTest() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $bundle = new FooBarBundle(); $kernel = $this->getKernel(array('getBundles')); diff --git a/core/vendor/symfony/http-kernel/Tests/Logger.php b/core/vendor/symfony/http-kernel/Tests/Logger.php index 017518a3059d..54300960d3fe 100644 --- a/core/vendor/symfony/http-kernel/Tests/Logger.php +++ b/core/vendor/symfony/http-kernel/Tests/Logger.php @@ -91,7 +91,7 @@ public function debug($message, array $context = array()) */ public function emerg($message, array $context = array()) { - trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED); + @trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED); $this->log('emergency', $message, $context); } @@ -101,7 +101,7 @@ public function emerg($message, array $context = array()) */ public function crit($message, array $context = array()) { - trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED); + @trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED); $this->log('critical', $message, $context); } @@ -111,7 +111,7 @@ public function crit($message, array $context = array()) */ public function err($message, array $context = array()) { - trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED); + @trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED); $this->log('error', $message, $context); } @@ -121,7 +121,7 @@ public function err($message, array $context = array()) */ public function warn($message, array $context = array()) { - trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED); + @trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED); $this->log('warning', $message, $context); } diff --git a/core/vendor/symfony/process/PhpExecutableFinder.php b/core/vendor/symfony/process/PhpExecutableFinder.php index 91d6d78a6703..f8f57cc536a2 100644 --- a/core/vendor/symfony/process/PhpExecutableFinder.php +++ b/core/vendor/symfony/process/PhpExecutableFinder.php @@ -37,7 +37,7 @@ public function find($includeArgs = true) { // HHVM support if (defined('HHVM_VERSION')) { - return (false !== ($hhvm = getenv('PHP_BINARY')) ? $hhvm : PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : ''); + return (getenv('PHP_BINARY') ?: PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : ''); } // PHP_BINARY return the current sapi executable diff --git a/core/vendor/symfony/process/ProcessUtils.php b/core/vendor/symfony/process/ProcessUtils.php index ef36a3f4ed52..4f30b630dcfe 100644 --- a/core/vendor/symfony/process/ProcessUtils.php +++ b/core/vendor/symfony/process/ProcessUtils.php @@ -49,7 +49,7 @@ public static function escapeArgument($argument) $escapedArgument = ''; $quote = false; - foreach (preg_split('/(")/i', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { + foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { if ('"' === $part) { $escapedArgument .= '\\"'; } elseif (self::isSurroundedBy($part, '%')) { diff --git a/core/vendor/symfony/process/Tests/AbstractProcessTest.php b/core/vendor/symfony/process/Tests/AbstractProcessTest.php index 2a4d583cb2b3..2add8cc93852 100644 --- a/core/vendor/symfony/process/Tests/AbstractProcessTest.php +++ b/core/vendor/symfony/process/Tests/AbstractProcessTest.php @@ -11,21 +11,30 @@ namespace Symfony\Component\Process\Tests; -use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\Exception\LogicException; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Exception\RuntimeException; +use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Pipes\PipesInterface; use Symfony\Component\Process\Process; -use Symfony\Component\Process\Exception\RuntimeException; /** * @author Robert Schönthal <seroscho@googlemail.com> */ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { + protected static $phpBin; + + public static function setUpBeforeClass() + { + $phpBin = new PhpExecutableFinder(); + self::$phpBin = $phpBin->find(); + } + public function testThatProcessDoesNotThrowWarningDuringRun() { @trigger_error('Test Error', E_USER_NOTICE); - $process = $this->getProcess("php -r 'sleep(3)'"); + $process = $this->getProcess(self::$phpBin." -r 'sleep(3)'"); $process->run(); $actualError = error_get_last(); $this->assertEquals('Test Error', $actualError['message']); @@ -95,7 +104,7 @@ public function testAllOutputIsActuallyReadOnTermination() $expectedOutputSize = PipesInterface::CHUNK_SIZE * 2 + 2; $code = sprintf('echo str_repeat(\'*\', %d);', $expectedOutputSize); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->start(); // Let's wait enough time for process to finish... @@ -134,7 +143,7 @@ public function testCallbacksAreExecutedWithStart() */ public function testProcessResponses($expected, $getter, $code) { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->run(); $this->assertSame($expected, $p->$getter()); @@ -150,7 +159,7 @@ public function testProcessPipes($code, $size) $expected = str_repeat(str_repeat('*', 1024), $size).'!'; $expectedLength = (1024 * $size) + 1; - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->setInput($expected); $p->run(); @@ -170,7 +179,7 @@ public function testSetStreamAsInput($code, $size) fwrite($stream, $expected); rewind($stream); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->setInput($stream); $p->run(); @@ -182,7 +191,7 @@ public function testSetStreamAsInput($code, $size) public function testSetInputWhileRunningThrowsAnException() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $process->start(); try { $process->setInput('foobar'); @@ -201,7 +210,7 @@ public function testSetInputWhileRunningThrowsAnException() */ public function testInvalidInput($value) { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); } @@ -218,7 +227,7 @@ public function provideInvalidInputValues() */ public function testValidInput($expected, $value) { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); $this->assertSame($expected, $process->getInput()); } @@ -238,9 +247,7 @@ public function provideInputValues() */ public function testLegacyValidInput($expected, $value) { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); $this->assertSame($expected, $process->getInput()); } @@ -278,7 +285,7 @@ public function testChainedCommandsOutput($expected, $operator, $input) public function testCallbackIsExecutedForOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('echo \'foo\';'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('echo \'foo\';'))); $called = false; $p->run(function ($type, $buffer) use (&$called) { @@ -290,7 +297,7 @@ public function testCallbackIsExecutedForOutput() public function testGetErrorOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->run(); $this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches)); @@ -303,7 +310,7 @@ public function testGetIncrementalErrorOutput() $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); while ($p->isRunning()) { @@ -319,7 +326,7 @@ public function testGetIncrementalErrorOutput() public function testFlushErrorOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->run(); $p->clearErrorOutput(); @@ -333,7 +340,7 @@ public function testGetEmptyIncrementalErrorOutput() $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); @@ -359,7 +366,7 @@ public function testGetEmptyIncrementalErrorOutput() public function testGetOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'))); $p->run(); $this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches)); @@ -372,7 +379,7 @@ public function testGetIncrementalOutput() $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); while ($p->isRunning()) { @@ -388,7 +395,7 @@ public function testGetIncrementalOutput() public function testFlushOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++;}'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++;}'))); $p->run(); $p->clearOutput(); @@ -402,7 +409,7 @@ public function testGetEmptyIncrementalOutput() $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); @@ -548,7 +555,7 @@ public function testExitCodeText() public function testStartIsNonBlocking() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $start = microtime(true); $process->start(); $end = microtime(true); @@ -558,14 +565,14 @@ public function testStartIsNonBlocking() public function testUpdateStatus() { - $process = $this->getProcess('php -h'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertTrue(strlen($process->getOutput()) > 0); } public function testGetExitCodeIsNullOnStart() { - $process = $this->getProcess('php -r "usleep(200000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(200000);"'); $this->assertNull($process->getExitCode()); $process->start(); $this->assertNull($process->getExitCode()); @@ -575,7 +582,7 @@ public function testGetExitCodeIsNullOnStart() public function testGetExitCodeIsNullOnWhenStartingAgain() { - $process = $this->getProcess('php -r "usleep(200000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(200000);"'); $process->run(); $this->assertEquals(0, $process->getExitCode()); $process->start(); @@ -586,14 +593,14 @@ public function testGetExitCodeIsNullOnWhenStartingAgain() public function testGetExitCode() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertSame(0, $process->getExitCode()); } public function testStatus() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $this->assertFalse($process->isRunning()); $this->assertFalse($process->isStarted()); $this->assertFalse($process->isTerminated()); @@ -612,7 +619,7 @@ public function testStatus() public function testStop() { - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $this->assertTrue($process->isRunning()); $process->stop(); @@ -621,14 +628,14 @@ public function testStop() public function testIsSuccessful() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertTrue($process->isSuccessful()); } public function testIsSuccessfulOnlyAfterTerminated() { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $process->start(); while ($process->isRunning()) { $this->assertFalse($process->isSuccessful()); @@ -640,7 +647,7 @@ public function testIsSuccessfulOnlyAfterTerminated() public function testIsNotSuccessful() { - $process = $this->getProcess('php -r "usleep(500000);throw new \Exception(\'BOUM\');"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);throw new \Exception(\'BOUM\');"'); $process->start(); $this->assertTrue($process->isRunning()); $process->wait(); @@ -653,7 +660,7 @@ public function testProcessIsNotSignaled() $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertFalse($process->hasBeenSignaled()); } @@ -664,7 +671,7 @@ public function testProcessWithoutTermSignalIsNotSignaled() $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertFalse($process->hasBeenSignaled()); } @@ -675,7 +682,7 @@ public function testProcessWithoutTermSignal() $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertEquals(0, $process->getTermSignal()); } @@ -686,7 +693,7 @@ public function testProcessIsSignaledIfStopped() $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $process->stop(); $this->assertTrue($process->hasBeenSignaled()); @@ -701,7 +708,7 @@ public function testProcessWithTermSignal() // SIGTERM is only defined if pcntl extension is present $termSignal = defined('SIGTERM') ? SIGTERM : 15; - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $process->stop(); @@ -730,7 +737,7 @@ public function testProcessThrowsExceptionWhenExternallySignaled() public function testRestart() { - $process1 = $this->getProcess('php -r "echo getmypid();"'); + $process1 = $this->getProcess(self::$phpBin.' -r "echo getmypid();"'); $process1->run(); $process2 = $process1->restart(); @@ -752,7 +759,7 @@ public function testPhpDeadlock() // Sleep doesn't work as it will allow the process to handle signals and close // file handles from the other end. - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess(self::$phpBin.' -r "while (true) {}"'); $process->start(); // PHP will deadlock when it tries to cleanup $process @@ -761,7 +768,7 @@ public function testPhpDeadlock() public function testRunProcessWithTimeout() { $timeout = 0.5; - $process = $this->getProcess('php -r "usleep(600000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(600000);"'); $process->setTimeout($timeout); $start = microtime(true); try { @@ -783,13 +790,13 @@ public function testRunProcessWithTimeout() public function testCheckTimeoutOnNonStartedProcess() { - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->checkTimeout(); } public function testCheckTimeoutOnTerminatedProcess() { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $process->checkTimeout(); } @@ -798,7 +805,7 @@ public function testCheckTimeoutOnStartedProcess() { $timeout = 0.5; $precision = 100000; - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->setTimeout($timeout); $start = microtime(true); @@ -820,7 +827,7 @@ public function testCheckTimeoutOnStartedProcess() public function testIdleTimeout() { - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->setTimeout(10); $process->setIdleTimeout(0.5); @@ -837,7 +844,7 @@ public function testIdleTimeout() public function testIdleTimeoutNotExceededWhenOutputIsSent() { - $process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }'))); + $process = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }'))); $process->setTimeout(2); $process->setIdleTimeout(1); @@ -853,7 +860,7 @@ public function testIdleTimeoutNotExceededWhenOutputIsSent() public function testStartAfterATimeout() { - $process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }'))); + $process = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }'))); $process->setTimeout(0.1); try { @@ -868,7 +875,7 @@ public function testStartAfterATimeout() public function testGetPid() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $process->start(); $this->assertGreaterThan(0, $process->getPid()); $process->wait(); @@ -876,13 +883,13 @@ public function testGetPid() public function testGetPidIsNullBeforeStart() { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $this->assertNull($process->getPid()); } public function testGetPidIsNullAfterRun() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertNull($process->getPid()); } @@ -927,7 +934,7 @@ public function testExitCodeIsAvailableAfterSignal() public function testSignalProcessNotRunning() { $this->verifyPosixIsEnabled(); - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->signal(SIGHUP); } @@ -936,7 +943,7 @@ public function testSignalProcessNotRunning() */ public function testMethodsThatNeedARunningProcess($method) { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', sprintf('Process must be started before calling %s.', $method)); $process->{$method}(); } @@ -957,7 +964,7 @@ public function provideMethodsThatNeedARunningProcess() */ public function testMethodsThatNeedATerminatedProcess($method) { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $process->start(); try { $process->{$method}(); @@ -999,7 +1006,7 @@ public function testSignalWithWrongIntSignal() $this->markTestSkipped('POSIX signals do not work on Windows'); } - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->start(); $process->signal(-4); } @@ -1013,14 +1020,14 @@ public function testSignalWithWrongNonIntSignal() $this->markTestSkipped('POSIX signals do not work on Windows'); } - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->start(); $process->signal('Céphalopodes'); } public function testDisableOutputDisablesTheOutput() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $this->assertFalse($p->isOutputDisabled()); $p->disableOutput(); $this->assertTrue($p->isOutputDisabled()); @@ -1030,7 +1037,7 @@ public function testDisableOutputDisablesTheOutput() public function testDisableOutputWhileRunningThrowsException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Disabling output while the process is running is not possible.'); $p->disableOutput(); @@ -1038,7 +1045,7 @@ public function testDisableOutputWhileRunningThrowsException() public function testEnableOutputWhileRunningThrowsException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Enabling output while the process is running is not possible.'); @@ -1047,7 +1054,7 @@ public function testEnableOutputWhileRunningThrowsException() public function testEnableOrDisableOutputAfterRunDoesNotThrowException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $p->wait(); @@ -1083,7 +1090,7 @@ public function testSetNullIdleTimeoutWhileOutputIsDisabled() */ public function testStartWithACallbackAndDisabledOutput($startMethod, $exception, $exceptionMessage) { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $this->setExpectedException($exception, $exceptionMessage); $p->{$startMethod}(function () {}); @@ -1103,7 +1110,7 @@ public function provideStartMethods() */ public function testGetOutputWhileDisabled($fetchMethod) { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Output has been disabled.'); diff --git a/core/vendor/symfony/process/Tests/ExecutableFinderTest.php b/core/vendor/symfony/process/Tests/ExecutableFinderTest.php index 20b12b1c3ce4..61a471b4f6df 100644 --- a/core/vendor/symfony/process/Tests/ExecutableFinderTest.php +++ b/core/vendor/symfony/process/Tests/ExecutableFinderTest.php @@ -102,7 +102,7 @@ public function testFindWithOpenBaseDir() $this->markTestSkipped('Cannot test when open_basedir is set'); } - $this->iniSet('open_basedir', dirname(PHP_BINARY).PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', dirname(PHP_BINARY).(!defined('HHVM_VERSION') ? PATH_SEPARATOR.'/' : '')); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName()); @@ -125,7 +125,7 @@ public function testFindProcessInOpenBasedir() } $this->setPath(''); - $this->iniSet('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', PHP_BINARY.(!defined('HHVM_VERSION') ? PATH_SEPARATOR.'/' : '')); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName(), false); diff --git a/core/vendor/symfony/process/Tests/PhpExecutableFinderTest.php b/core/vendor/symfony/process/Tests/PhpExecutableFinderTest.php index 8f8623930ff8..cd4abedc9df7 100644 --- a/core/vendor/symfony/process/Tests/PhpExecutableFinderTest.php +++ b/core/vendor/symfony/process/Tests/PhpExecutableFinderTest.php @@ -53,10 +53,10 @@ public function testFindWithHHVM() $f = new PhpExecutableFinder(); - $current = $f->find(); + $current = getenv('PHP_BINARY') ?: PHP_BINARY; - $this->assertEquals($f->find(), $current.' --php', '::find() returns the executable PHP'); - $this->assertEquals($f->find(false), $current, '::find() returns the executable PHP'); + $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP'); + $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); } /** diff --git a/core/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/core/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index 89d1f6a1acaf..26673ea45a1c 100644 --- a/core/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/core/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -32,7 +32,7 @@ } $out = (binary) substr($out, $written); } - if (null === $read && strlen($out) < 1) { + if (null === $read && '' === $out) { $write = array_diff($write, array(STDOUT)); } @@ -43,7 +43,7 @@ } $err = (binary) substr($err, $written); } - if (null === $read && strlen($err) < 1) { + if (null === $read && '' === $err) { $write = array_diff($write, array(STDERR)); } diff --git a/core/vendor/symfony/process/Tests/SimpleProcessTest.php b/core/vendor/symfony/process/Tests/SimpleProcessTest.php index 4bf9ad87c6f0..98eeb0ecbc9a 100644 --- a/core/vendor/symfony/process/Tests/SimpleProcessTest.php +++ b/core/vendor/symfony/process/Tests/SimpleProcessTest.php @@ -150,7 +150,7 @@ public function testSignalWithWrongNonIntSignal() public function testStopTerminatesProcessCleanly() { try { - $process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); $process->run(function () use ($process) { $process->stop(); }); @@ -164,7 +164,7 @@ public function testKillSignalTerminatesProcessCleanly() $this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.'); try { - $process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); $process->run(function () use ($process) { if ($process->isRunning()) { $process->signal(defined('SIGKILL') ? SIGKILL : 9); @@ -180,7 +180,7 @@ public function testTermSignalTerminatesProcessCleanly() $this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.'); try { - $process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); $process->run(function () use ($process) { if ($process->isRunning()) { $process->signal(defined('SIGTERM') ? SIGTERM : 15); diff --git a/core/vendor/symfony/routing/Annotation/Route.php b/core/vendor/symfony/routing/Annotation/Route.php index d5bfea576873..7e7e056bd167 100644 --- a/core/vendor/symfony/routing/Annotation/Route.php +++ b/core/vendor/symfony/routing/Annotation/Route.php @@ -48,7 +48,7 @@ public function __construct(array $data) foreach ($data as $key => $value) { $method = 'set'.str_replace('_', '', $key); if (!method_exists($this, $method)) { - throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this))); + throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this))); } $this->$method($value); } diff --git a/core/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php b/core/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php index de414480f22b..aa7df8a78b5b 100644 --- a/core/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/core/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php @@ -229,11 +229,11 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren $conditions[] = sprintf("rtrim(\$pathinfo, '/') === %s", var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true)); $hasTrailingSlash = true; } else { - $conditions[] = sprintf("\$pathinfo === %s", var_export(str_replace('\\', '', $m['url']), true)); + $conditions[] = sprintf('$pathinfo === %s', var_export(str_replace('\\', '', $m['url']), true)); } } else { if ($compiledRoute->getStaticPrefix() && $compiledRoute->getStaticPrefix() !== $parentPrefix) { - $conditions[] = sprintf("0 === strpos(\$pathinfo, %s)", var_export($compiledRoute->getStaticPrefix(), true)); + $conditions[] = sprintf('0 === strpos($pathinfo, %s)', var_export($compiledRoute->getStaticPrefix(), true)); } $regex = $compiledRoute->getRegex(); @@ -241,7 +241,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren $regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2); $hasTrailingSlash = true; } - $conditions[] = sprintf("preg_match(%s, \$pathinfo, \$matches)", var_export($regex, true)); + $conditions[] = sprintf('preg_match(%s, $pathinfo, $matches)', var_export($regex, true)); $matches = true; } diff --git a/core/vendor/symfony/routing/Tests/Annotation/RouteTest.php b/core/vendor/symfony/routing/Tests/Annotation/RouteTest.php index 5eda4064f059..3b340b33eeae 100644 --- a/core/vendor/symfony/routing/Tests/Annotation/RouteTest.php +++ b/core/vendor/symfony/routing/Tests/Annotation/RouteTest.php @@ -52,8 +52,6 @@ public function getValidParameters() */ public function testLegacyGetPattern() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $route = new Route(array('value' => '/Blog')); $this->assertEquals($route->getPattern(), '/Blog'); } diff --git a/core/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php b/core/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php index 6fbf7e220348..525b9f569303 100644 --- a/core/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php +++ b/core/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php @@ -39,7 +39,7 @@ protected function setUp() $this->routeCollection = new RouteCollection(); $this->generatorDumper = new PhpGeneratorDumper($this->routeCollection); - $this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.php'; + $this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php'; @unlink($this->testTmpFilepath); } diff --git a/core/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php b/core/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php index 0005e3a53467..29460c7aeb19 100644 --- a/core/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php +++ b/core/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php @@ -461,8 +461,6 @@ public function testHostIsCaseInsensitive() */ public function testLegacyGenerateNetworkPath() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $routes = $this->getRoutes('test', new Route('/{name}', array(), array('_scheme' => 'http'), array(), '{locale}.example.com')); $this->assertSame('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', diff --git a/core/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php b/core/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php index 37bbc0cd6929..78065070a0a7 100644 --- a/core/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php +++ b/core/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php @@ -50,8 +50,6 @@ public function testLoadWithRoute() */ public function testLegacyRouteDefinitionLoading() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); $routeCollection = $loader->load('legacy_validpattern.xml'); $route = $routeCollection->get('blog_show_legacy'); diff --git a/core/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php b/core/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php index f9b7547a1bef..17e07dab1930 100644 --- a/core/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php +++ b/core/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php @@ -86,8 +86,6 @@ public function testLoadWithRoute() */ public function testLegacyRouteDefinitionLoading() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); $routeCollection = $loader->load('legacy_validpattern.yml'); $route = $routeCollection->get('blog_show_legacy'); diff --git a/core/vendor/symfony/routing/Tests/Matcher/Dumper/LegacyApacheMatcherDumperTest.php b/core/vendor/symfony/routing/Tests/Matcher/Dumper/LegacyApacheMatcherDumperTest.php index 6d34c96d5660..4bf513e9a6b3 100644 --- a/core/vendor/symfony/routing/Tests/Matcher/Dumper/LegacyApacheMatcherDumperTest.php +++ b/core/vendor/symfony/routing/Tests/Matcher/Dumper/LegacyApacheMatcherDumperTest.php @@ -27,11 +27,6 @@ public static function setUpBeforeClass() self::$fixturesPath = realpath(__DIR__.'/../../Fixtures/'); } - protected function setUp() - { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - public function testDump() { $dumper = new ApacheMatcherDumper($this->getRouteCollection()); diff --git a/core/vendor/symfony/routing/Tests/Matcher/LegacyApacheUrlMatcherTest.php b/core/vendor/symfony/routing/Tests/Matcher/LegacyApacheUrlMatcherTest.php index f42b7f206b1f..931f910df4c5 100644 --- a/core/vendor/symfony/routing/Tests/Matcher/LegacyApacheUrlMatcherTest.php +++ b/core/vendor/symfony/routing/Tests/Matcher/LegacyApacheUrlMatcherTest.php @@ -24,7 +24,6 @@ class LegacyApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->server = $_SERVER; } diff --git a/core/vendor/symfony/routing/Tests/RouteTest.php b/core/vendor/symfony/routing/Tests/RouteTest.php index 11c0cd8dcf00..85273a696a80 100644 --- a/core/vendor/symfony/routing/Tests/RouteTest.php +++ b/core/vendor/symfony/routing/Tests/RouteTest.php @@ -169,8 +169,6 @@ public function testScheme() */ public function testLegacySchemeRequirement() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $route = new Route('/'); $route->setRequirement('_scheme', 'http|https'); $this->assertEquals('http|https', $route->getRequirement('_scheme')); @@ -199,8 +197,6 @@ public function testMethod() */ public function testLegacyMethodRequirement() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $route = new Route('/'); $route->setRequirement('_method', 'GET|POST'); $this->assertEquals('GET|POST', $route->getRequirement('_method')); @@ -233,8 +229,6 @@ public function testCompile() */ public function testLegacyPattern() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $route = new Route('/{foo}'); $this->assertEquals('/{foo}', $route->getPattern()); diff --git a/core/vendor/symfony/serializer/Annotation/Groups.php b/core/vendor/symfony/serializer/Annotation/Groups.php index e88ffa71d7e2..519837a55b73 100644 --- a/core/vendor/symfony/serializer/Annotation/Groups.php +++ b/core/vendor/symfony/serializer/Annotation/Groups.php @@ -30,21 +30,22 @@ class Groups /** * @param array $data - * @throws \InvalidArgumentException + * + * @throws InvalidArgumentException */ public function __construct(array $data) { if (!isset($data['value']) || !$data['value']) { - throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' cannot be empty.", get_class($this))); + throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" cannot be empty.', get_class($this))); } if (!is_array($data['value'])) { - throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' must be an array of strings.", get_class($this))); + throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be an array of strings.', get_class($this))); } foreach ($data['value'] as $group) { if (!is_string($group)) { - throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' must be an array of strings.", get_class($this))); + throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be an array of strings.', get_class($this))); } } @@ -52,7 +53,7 @@ public function __construct(array $data) } /** - * Gets groups + * Gets groups. * * @return array */ diff --git a/core/vendor/symfony/serializer/Mapping/ClassMetadata.php b/core/vendor/symfony/serializer/Mapping/ClassMetadata.php index 3794a7451b55..55ddf52a64bb 100644 --- a/core/vendor/symfony/serializer/Mapping/ClassMetadata.php +++ b/core/vendor/symfony/serializer/Mapping/ClassMetadata.php @@ -110,7 +110,7 @@ public function __sleep() { return array( 'name', - 'attributes', + 'attributesMetadata', ); } } diff --git a/core/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php b/core/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php index 8d070d78bc1f..78c82ff990a1 100644 --- a/core/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php +++ b/core/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php @@ -288,7 +288,7 @@ protected function prepareForDenormalization($data) } /** - * Instantiates an object using contructor parameters when needed. + * Instantiates an object using constructor parameters when needed. * * This method also allows to denormalize data into an existing object if * it is present in the context with the object_to_populate key. diff --git a/core/vendor/symfony/serializer/Tests/Annotation/GroupsTest.php b/core/vendor/symfony/serializer/Tests/Annotation/GroupsTest.php index b427325f0864..72b877729dc8 100644 --- a/core/vendor/symfony/serializer/Tests/Annotation/GroupsTest.php +++ b/core/vendor/symfony/serializer/Tests/Annotation/GroupsTest.php @@ -19,7 +19,7 @@ class GroupsTest extends \PHPUnit_Framework_TestCase { /** - * @expectedException \InvalidArgumentException + * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException */ public function testEmptyGroupsParameter() { @@ -27,7 +27,7 @@ public function testEmptyGroupsParameter() } /** - * @expectedException \InvalidArgumentException + * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException */ public function testNotAnArrayGroupsParameter() { @@ -35,7 +35,7 @@ public function testNotAnArrayGroupsParameter() } /** - * @expectedException \InvalidArgumentException + * @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException */ public function testInvalidGroupsParameter() { diff --git a/core/vendor/symfony/serializer/Tests/Mapping/AttributeMetadataTest.php b/core/vendor/symfony/serializer/Tests/Mapping/AttributeMetadataTest.php index f22746bc5de7..4a32831cb698 100644 --- a/core/vendor/symfony/serializer/Tests/Mapping/AttributeMetadataTest.php +++ b/core/vendor/symfony/serializer/Tests/Mapping/AttributeMetadataTest.php @@ -54,4 +54,14 @@ public function testMerge() $this->assertEquals(array('a', 'b', 'c'), $attributeMetadata1->getGroups()); } + + public function testSerialize() + { + $attributeMetadata = new AttributeMetadata('attribute'); + $attributeMetadata->addGroup('a'); + $attributeMetadata->addGroup('b'); + + $serialized = serialize($attributeMetadata); + $this->assertEquals($attributeMetadata, unserialize($serialized)); + } } diff --git a/core/vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php b/core/vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php index 90017580ac70..629c17b788d2 100644 --- a/core/vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php +++ b/core/vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php @@ -62,4 +62,21 @@ public function testMerge() $this->assertEquals(array('a1' => $ac1), $classMetadata2->getAttributesMetadata()); } + + public function testSerialize() + { + $classMetadata = new ClassMetadata('a'); + + $a1 = $this->getMock('Symfony\Component\Serializer\Mapping\AttributeMetadataInterface'); + $a1->method('getName')->willReturn('b1'); + + $a2 = $this->getMock('Symfony\Component\Serializer\Mapping\AttributeMetadataInterface'); + $a2->method('getName')->willReturn('b2'); + + $classMetadata->addAttributeMetadata($a1); + $classMetadata->addAttributeMetadata($a2); + + $serialized = serialize($classMetadata); + $this->assertEquals($classMetadata, unserialize($serialized)); + } } diff --git a/core/vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/core/vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index e8156dd10fb9..92051863d598 100644 --- a/core/vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/core/vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -105,8 +105,6 @@ public function testDenormalizeWithObject() */ public function testLegacyDenormalizeOnCamelCaseFormat() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->normalizer->setCamelizedAttributes(array('camel_case')); $obj = $this->normalizer->denormalize( array('camel_case' => 'camelCase'), @@ -136,8 +134,6 @@ public function testDenormalizeNull() */ public function testLegacyCamelizedAttributesNormalize() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $obj = new GetCamelizedDummy('dunglas.fr'); $obj->setFooBar('les-tilleuls.coop'); $obj->setBar_foo('lostinthesupermarket.fr'); @@ -162,8 +158,6 @@ public function testLegacyCamelizedAttributesNormalize() */ public function testLegacyCamelizedAttributesDenormalize() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $obj = new GetCamelizedDummy('dunglas.fr'); $obj->setFooBar('les-tilleuls.coop'); $obj->setBar_foo('lostinthesupermarket.fr'); diff --git a/core/vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php b/core/vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php index 14a268f5bc0e..7d9da645c4f4 100644 --- a/core/vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php +++ b/core/vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php @@ -102,8 +102,6 @@ public function testDenormalizeWithObject() */ public function testLegacyDenormalizeOnCamelCaseFormat() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->normalizer->setCamelizedAttributes(array('camel_case')); $obj = $this->normalizer->denormalize( array('camel_case' => 'camelCase'), diff --git a/core/vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php b/core/vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php index 52ce54087c34..62e6d5d925ca 100644 --- a/core/vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php +++ b/core/vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php @@ -68,8 +68,6 @@ public function testDenormalize() */ public function testLegacyDenormalizeOnCamelCaseFormat() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->normalizer->setCamelizedAttributes(array('camel_case')); $obj = $this->normalizer->denormalize( array('camel_case' => 'value'), @@ -83,8 +81,6 @@ public function testLegacyDenormalizeOnCamelCaseFormat() */ public function testLegacyCamelizedAttributesNormalize() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $obj = new PropertyCamelizedDummy('dunglas.fr'); $obj->fooBar = 'les-tilleuls.coop'; $obj->bar_foo = 'lostinthesupermarket.fr'; @@ -109,8 +105,6 @@ public function testLegacyCamelizedAttributesNormalize() */ public function testLegacyCamelizedAttributesDenormalize() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $obj = new PropertyCamelizedDummy('dunglas.fr'); $obj->fooBar = 'les-tilleuls.coop'; $obj->bar_foo = 'lostinthesupermarket.fr'; diff --git a/core/vendor/symfony/translation/Loader/JsonFileLoader.php b/core/vendor/symfony/translation/Loader/JsonFileLoader.php index 09138835a607..81717f3d9418 100644 --- a/core/vendor/symfony/translation/Loader/JsonFileLoader.php +++ b/core/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -20,7 +20,7 @@ * * @author singles */ -class JsonFileLoader extends ArrayLoader implements LoaderInterface +class JsonFileLoader extends ArrayLoader { /** * {@inheritdoc} diff --git a/core/vendor/symfony/translation/PluralizationRules.php b/core/vendor/symfony/translation/PluralizationRules.php index e1eac82ce9b5..3ef8f00b6e93 100644 --- a/core/vendor/symfony/translation/PluralizationRules.php +++ b/core/vendor/symfony/translation/PluralizationRules.php @@ -55,6 +55,7 @@ public static function get($number, $locale) * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) */ switch ($locale) { + case 'az': case 'bo': case 'dz': case 'id': @@ -73,7 +74,6 @@ public static function get($number, $locale) break; case 'af': - case 'az': case 'bn': case 'bg': case 'ca': diff --git a/core/vendor/symfony/translation/Tests/TranslatorTest.php b/core/vendor/symfony/translation/Tests/TranslatorTest.php index 3ee9be019dd2..cb361831883e 100644 --- a/core/vendor/symfony/translation/Tests/TranslatorTest.php +++ b/core/vendor/symfony/translation/Tests/TranslatorTest.php @@ -502,7 +502,7 @@ public function testTransChoiceFallbackWithNoTranslation() public function testGetMessages($resources, $locale, $expected) { $locales = array_keys($resources); - $_locale = !is_null($locale) ? $locale : reset($locales); + $_locale = null !== $locale ? $locale : reset($locales); $locales = array_slice($locales, 0, array_search($_locale, $locales)); $translator = new Translator($_locale, new MessageSelector()); diff --git a/core/vendor/symfony/validator/Constraints/CallbackValidator.php b/core/vendor/symfony/validator/Constraints/CallbackValidator.php index 9939306cb85d..eaf2f3c0114c 100644 --- a/core/vendor/symfony/validator/Constraints/CallbackValidator.php +++ b/core/vendor/symfony/validator/Constraints/CallbackValidator.php @@ -60,7 +60,7 @@ public function validate($object, Constraint $constraint) call_user_func($method, $object, $this->context); } elseif (null !== $object) { if (!method_exists($object, $method)) { - throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist', $method)); + throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class %s', $method, get_class($object))); } $reflMethod = new \ReflectionMethod($object, $method); diff --git a/core/vendor/symfony/validator/Constraints/CardSchemeValidator.php b/core/vendor/symfony/validator/Constraints/CardSchemeValidator.php index 708ae09390b3..229e0d2c1899 100644 --- a/core/vendor/symfony/validator/Constraints/CardSchemeValidator.php +++ b/core/vendor/symfony/validator/Constraints/CardSchemeValidator.php @@ -24,6 +24,7 @@ * * @see http://en.wikipedia.org/wiki/Bank_card_number * @see http://www.regular-expressions.info/creditcard.html + * @see http://www.barclaycard.co.uk/business/files/Ranges_and_Rules_September_2014.pdf */ class CardSchemeValidator extends ConstraintValidator { @@ -64,10 +65,13 @@ class CardSchemeValidator extends ConstraintValidator 'LASER' => array( '/^(6304|670[69]|6771)[0-9]{12,15}$/', ), - // Maestro cards begin with either 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 or 0604 - // They have between 12 and 19 digits. + // Maestro international cards begin with 675900..675999 and have between 12 and 19 digits. + // Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits. 'MAESTRO' => array( - '/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/', + '/^(6759[0-9]{2})[0-9]{6,13}$/', + '/^(50[0-9]{4})[0-9]{6,13}$/', + '/^5[6-9][0-9]{10,17}$/', + '/^6[0-9]{11,18}$/', ), // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. 'MASTERCARD' => array( diff --git a/core/vendor/symfony/validator/Constraints/EmailValidator.php b/core/vendor/symfony/validator/Constraints/EmailValidator.php index 95f9aa123bfb..ab1e9ba8fb01 100644 --- a/core/vendor/symfony/validator/Constraints/EmailValidator.php +++ b/core/vendor/symfony/validator/Constraints/EmailValidator.php @@ -25,8 +25,6 @@ class EmailValidator extends ConstraintValidator { /** - * isStrict - * * @var bool */ private $isStrict; @@ -81,7 +79,7 @@ public function validate($value, Constraint $constraint) return; } - } elseif (!preg_match('/.+\@.+\..+/', $value)) { + } elseif (!preg_match('/^.+\@\S+\.\S+$/', $value)) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) diff --git a/core/vendor/symfony/validator/Constraints/File.php b/core/vendor/symfony/validator/Constraints/File.php index ae0ad6739559..f35f93cdb5e0 100644 --- a/core/vendor/symfony/validator/Constraints/File.php +++ b/core/vendor/symfony/validator/Constraints/File.php @@ -40,7 +40,6 @@ class File extends Constraint self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', ); - public $maxSize; public $binaryFormat; public $mimeTypes = array(); public $notFoundMessage = 'The file could not be found.'; @@ -58,29 +57,56 @@ class File extends Constraint public $uploadExtensionErrorMessage = 'A PHP extension caused the upload to fail.'; public $uploadErrorMessage = 'The file could not be uploaded.'; + protected $maxSize; + public function __construct($options = null) { parent::__construct($options); - if ($this->maxSize) { - if (ctype_digit((string) $this->maxSize)) { - $this->maxSize = (int) $this->maxSize; - $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; - } elseif (preg_match('/^\d++k$/i', $this->maxSize)) { - $this->maxSize = $this->maxSize * 1000; - $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; - } elseif (preg_match('/^\d++M$/i', $this->maxSize)) { - $this->maxSize = $this->maxSize * 1000000; - $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; - } elseif (preg_match('/^\d++Ki$/i', $this->maxSize)) { - $this->maxSize = $this->maxSize << 10; - $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; - } elseif (preg_match('/^\d++Mi$/i', $this->maxSize)) { - $this->maxSize = $this->maxSize << 20; - $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; - } else { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize)); - } + if (null !== $this->maxSize) { + $this->normalizeBinaryFormat($this->maxSize); + } + } + + public function __set($option, $value) + { + if ('maxSize' === $option) { + $this->normalizeBinaryFormat($value); + + return; + } + + parent::__set($option, $value); + } + + public function __get($option) + { + if ('maxSize' === $option) { + return $this->maxSize; + } + + return parent::__get($option); + } + + private function normalizeBinaryFormat($maxSize) + { + if (ctype_digit((string) $maxSize)) { + $this->maxSize = (int) $maxSize; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++k$/i', $maxSize)) { + $this->maxSize = $maxSize * 1000; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++M$/i', $maxSize)) { + $this->maxSize = $maxSize * 1000000; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++Ki$/i', $maxSize)) { + $this->maxSize = $maxSize << 10; + $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; + } elseif (preg_match('/^\d++Mi$/i', $maxSize)) { + $this->maxSize = $maxSize << 20; + $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; + } else { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize)); } } } diff --git a/core/vendor/symfony/validator/Resources/translations/validators.it.xlf b/core/vendor/symfony/validator/Resources/translations/validators.it.xlf index 5a411eaa0ac9..b1dcb1e7b621 100644 --- a/core/vendor/symfony/validator/Resources/translations/validators.it.xlf +++ b/core/vendor/symfony/validator/Resources/translations/validators.it.xlf @@ -40,7 +40,7 @@ </trans-unit> <trans-unit id="10"> <source>This field is missing.</source> - <target>Questo campo è manca.</target> + <target>Questo campo è mancante.</target> </trans-unit> <trans-unit id="11"> <source>This value is not a valid date.</source> diff --git a/core/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/core/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php index e23709f3fcfe..b5e2a7a97ddb 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -51,10 +51,6 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected function setUp() { - if (Validation::API_VERSION_2_5 !== $this->getApiVersion()) { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - } - $this->group = 'MyGroup'; $this->metadata = null; $this->object = null; diff --git a/core/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php b/core/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php index b53f6c6995cc..b619291665e9 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php @@ -191,8 +191,6 @@ public function testArrayCallableExplicitName() */ public function testLegacySingleMethodBc() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array('validate')); @@ -209,8 +207,6 @@ public function testLegacySingleMethodBc() */ public function testLegacySingleMethodBcExplicitName() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array('methods' => array('validate'))); @@ -227,8 +223,6 @@ public function testLegacySingleMethodBcExplicitName() */ public function testLegacyMultipleMethodsBc() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array('validate', 'validateStatic')); @@ -247,8 +241,6 @@ public function testLegacyMultipleMethodsBc() */ public function testLegacyMultipleMethodsBcExplicitName() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array( 'methods' => array('validate', 'validateStatic'), @@ -269,8 +261,6 @@ public function testLegacyMultipleMethodsBcExplicitName() */ public function testLegacySingleStaticMethodBc() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array( array(__CLASS__.'_Class', 'validateCallback'), @@ -289,8 +279,6 @@ public function testLegacySingleStaticMethodBc() */ public function testLegacySingleStaticMethodBcExplicitName() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array( 'methods' => array(array(__CLASS__.'_Class', 'validateCallback')), @@ -329,8 +317,6 @@ public function testExpectValidCallbacks() */ public function testLegacyExpectEitherCallbackOrMethods() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $object = new CallbackValidatorTest_Object(); $this->validator->validate($object, new Callback(array( diff --git a/core/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php b/core/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php index aab54e590f0d..2d623c97846e 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php @@ -97,8 +97,10 @@ public function getValidNumbers() array('LASER', '6771656738314582216'), array('MAESTRO', '6759744069209'), array('MAESTRO', '5020507657408074712'), + array('MAESTRO', '5612559223580173965'), array('MAESTRO', '6759744069209'), array('MAESTRO', '6759744069209'), + array('MAESTRO', '6594371785970435599'), array('MASTERCARD', '5555555555554444'), array('MASTERCARD', '5105105105105100'), array('VISA', '4111111111111111'), diff --git a/core/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php b/core/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php index 0361333fdc16..7e7a5cc70f0d 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php @@ -91,6 +91,7 @@ public function getInvalidEmails() array('example'), array('example@'), array('example@localhost'), + array('foo@example.com bar'), ); } diff --git a/core/vendor/symfony/validator/Tests/Constraints/FileTest.php b/core/vendor/symfony/validator/Tests/Constraints/FileTest.php index 2ee46813bf8b..fbd4b074260b 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/FileTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/FileTest.php @@ -12,13 +12,14 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\File; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; class FileTest extends \PHPUnit_Framework_TestCase { /** * @param mixed $maxSize - * @param int bytes - * @param bool $bytes + * @param int $bytes + * @param bool $binaryFormat * @dataProvider provideValidSizes */ public function testMaxSize($maxSize, $bytes, $binaryFormat) @@ -29,11 +30,55 @@ public function testMaxSize($maxSize, $bytes, $binaryFormat) $this->assertSame($binaryFormat, $file->binaryFormat); } + /** + * @dataProvider provideValidSizes + * + * @param int|string $maxSize + * @param int $bytes + * @param string $binaryFormat + */ + public function testMaxSizeCanBeSetAfterInitialization($maxSize, $bytes, $binaryFormat) + { + $file = new File(); + $file->maxSize = $maxSize; + + $this->assertSame($bytes, $file->maxSize); + $this->assertSame($binaryFormat, $file->binaryFormat); + } + + /** + * @dataProvider provideInvalidSizes + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + * + * @param int|string $maxSize + */ + public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization($maxSize) + { + $file = new File(array('maxSize' => 1000)); + $file->maxSize = $maxSize; + } + + /** + * @dataProvider provideInvalidSizes + * + * @param int|string $maxSize + */ + public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize) + { + $file = new File(array('maxSize' => 1000)); + + try { + $file->maxSize = $maxSize; + } catch (ConstraintDefinitionException $e) { + } + + $this->assertSame(1000, $file->maxSize); + } + /** * @param mixed $maxSize - * @param int $bytes * @dataProvider provideInValidSizes - * @expectedException Symfony\Component\Validator\Exception\ConstraintDefinitionException + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException */ public function testInvalideMaxSize($maxSize) { diff --git a/core/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php b/core/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php index 30f024537289..aa2d601042c5 100644 --- a/core/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php +++ b/core/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php @@ -37,8 +37,6 @@ public function testCreateDoctrineStyle() */ public function testLegacyIterate() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $sequence = new GroupSequence(array('Group 1', 'Group 2')); $this->assertSame(array('Group 1', 'Group 2'), iterator_to_array($sequence)); @@ -49,8 +47,6 @@ public function testLegacyIterate() */ public function testLegacyCount() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $sequence = new GroupSequence(array('Group 1', 'Group 2')); $this->assertCount(2, $sequence); @@ -61,8 +57,6 @@ public function testLegacyCount() */ public function testLegacyArrayAccess() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $sequence = new GroupSequence(array('Group 1', 'Group 2')); $this->assertSame('Group 1', $sequence[0]); @@ -85,8 +79,6 @@ public function testLegacyArrayAccess() */ public function testLegacyGetExpectsExistingKey() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $sequence = new GroupSequence(array('Group 1', 'Group 2')); $sequence[2]; @@ -97,8 +89,6 @@ public function testLegacyGetExpectsExistingKey() */ public function testLegacyUnsetIgnoresNonExistingKeys() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $sequence = new GroupSequence(array('Group 1', 'Group 2')); // should not fail diff --git a/core/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php b/core/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php index 4fec2aacb56a..f0139c0da5ff 100644 --- a/core/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php +++ b/core/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php @@ -41,8 +41,6 @@ class LegacyExecutionContextTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->visitor = $this->getMockBuilder('Symfony\Component\Validator\ValidationVisitor') ->disableOriginalConstructor() ->getMock(); diff --git a/core/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php b/core/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php index bb69cf5e7497..9d39784280e3 100644 --- a/core/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php +++ b/core/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php @@ -20,8 +20,6 @@ class LegacyApcCacheTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) { $this->markTestSkipped('APC is not loaded.'); } diff --git a/core/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php b/core/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php index c77e6fe9aa15..b68c88293f19 100644 --- a/core/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php +++ b/core/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php @@ -24,8 +24,6 @@ class LegacyElementMetadataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $this->metadata = new TestElementMetadata(); } diff --git a/core/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php b/core/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php index a4473bc68a03..fafde341ac06 100644 --- a/core/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php +++ b/core/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php @@ -40,8 +40,6 @@ protected function tearDown() */ public function testLegacyAddValidSetsMemberToCascaded() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $result = $this->metadata->addConstraint(new Valid()); $this->assertEquals(array(), $this->metadata->getConstraints()); @@ -54,8 +52,6 @@ public function testLegacyAddValidSetsMemberToCascaded() */ public function testLegacyAddOtherConstraintDoesNotSetMemberToCascaded() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $result = $this->metadata->addConstraint($constraint = new ConstraintA()); $this->assertEquals(array($constraint), $this->metadata->getConstraints()); diff --git a/core/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php b/core/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php index 4a041afbff0d..12c8d87f2ca5 100644 --- a/core/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php +++ b/core/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php @@ -75,6 +75,12 @@ public function testValidateConstraintWithoutGroup() $this->assertCount(1, $violations); } + public function testValidateWithEmptyArrayAsConstraint() + { + $violations = $this->validator->validate('value', array()); + $this->assertCount(0, $violations); + } + public function testGroupSequenceAbortsAfterFailedGroup() { $entity = new Entity(); @@ -578,8 +584,6 @@ public function testReferenceMetadataMustImplementClassMetadataInterface() */ public function testLegacyPropertyMetadataMustImplementPropertyMetadataInterface() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $entity = new Entity(); // Legacy interface diff --git a/core/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php b/core/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php index 77ec10212a37..5f4167dcd884 100644 --- a/core/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php +++ b/core/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php @@ -42,8 +42,6 @@ abstract protected function createValidator(MetadataFactoryInterface $metadataFa protected function setUp() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - parent::setUp(); $this->validator = $this->createValidator($this->metadataFactory); diff --git a/core/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php b/core/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php index d8833dedcfb4..69c025d4594e 100644 --- a/core/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php +++ b/core/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php @@ -844,8 +844,6 @@ public function testValidateProperty() */ public function testLegacyValidatePropertyFailsIfPropertiesNotSupported() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); @@ -977,8 +975,6 @@ public function testValidatePropertyValueWithClassName() */ public function testLegacyValidatePropertyValueFailsIfPropertiesNotSupported() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); diff --git a/core/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php b/core/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php index 05961269a555..b27e6454bea7 100644 --- a/core/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php +++ b/core/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php @@ -15,6 +15,7 @@ use Symfony\Component\Validator\ConstraintValidatorFactory; use Symfony\Component\Validator\Context\ExecutionContextFactory; use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Tests\Fixtures\Entity; use Symfony\Component\Validator\Validator\RecursiveValidator; class RecursiveValidator2Dot5ApiTest extends Abstract2Dot5ApiTest @@ -29,4 +30,28 @@ protected function createValidator(MetadataFactoryInterface $metadataFactory, ar return new RecursiveValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); } + + public function testEmptyGroupsArrayDoesNotTriggerDeprecation() + { + $entity = new Entity(); + + $validatorContext = $this->getMock('Symfony\Component\Validator\Validator\ContextualValidatorInterface'); + $validatorContext + ->expects($this->once()) + ->method('validate') + ->with($entity, null, array()) + ->willReturnSelf(); + + $validator = $this + ->getMockBuilder('Symfony\Component\Validator\Validator\RecursiveValidator') + ->disableOriginalConstructor() + ->setMethods(array('startContext')) + ->getMock(); + $validator + ->expects($this->once()) + ->method('startContext') + ->willReturn($validatorContext); + + $validator->validate($entity, null, array()); + } } diff --git a/core/vendor/symfony/validator/Validator/RecursiveValidator.php b/core/vendor/symfony/validator/Validator/RecursiveValidator.php index 2d66a23fe365..e4dc0fb057d2 100644 --- a/core/vendor/symfony/validator/Validator/RecursiveValidator.php +++ b/core/vendor/symfony/validator/Validator/RecursiveValidator.php @@ -25,6 +25,7 @@ * Recursive implementation of {@link ValidatorInterface}. * * @since 2.5 + * * @author Bernhard Schussek <bschussek@gmail.com> */ class RecursiveValidator implements ValidatorInterface, LegacyValidatorInterface @@ -177,11 +178,11 @@ public function getMetadataFactory() private static function testConstraints($constraints) { - return null === $constraints || $constraints instanceof Constraint || (is_array($constraints) && current($constraints) instanceof Constraint); + return null === $constraints || $constraints instanceof Constraint || (is_array($constraints) && (0 === count($constraints) || current($constraints) instanceof Constraint)); } private static function testGroups($groups) { - return null === $groups || is_string($groups) || $groups instanceof GroupSequence || (is_array($groups) && (is_string(current($groups)) || current($groups) instanceof GroupSequence)); + return null === $groups || is_string($groups) || $groups instanceof GroupSequence || (is_array($groups) && (0 === count($groups) || is_string(current($groups)) || current($groups) instanceof GroupSequence)); } } diff --git a/core/vendor/symfony/yaml/Inline.php b/core/vendor/symfony/yaml/Inline.php index 52ea724cf407..6e3877bff041 100644 --- a/core/vendor/symfony/yaml/Inline.php +++ b/core/vendor/symfony/yaml/Inline.php @@ -48,7 +48,7 @@ public static function parse($value, $exceptionOnInvalidType = false, $objectSup $value = trim($value); - if (0 == strlen($value)) { + if ('' === $value) { return ''; } diff --git a/core/vendor/symfony/yaml/Parser.php b/core/vendor/symfony/yaml/Parser.php index d72c7639c833..cd5e1dc571fd 100644 --- a/core/vendor/symfony/yaml/Parser.php +++ b/core/vendor/symfony/yaml/Parser.php @@ -546,9 +546,9 @@ private function parseFoldedScalar($separator, $indicator = '', $indentation = 0 // deal with trailing newlines as indicated if ('' === $indicator) { - $text = preg_replace('/\n+$/s', "\n", $text); + $text = preg_replace('/\n+$/', "\n", $text); } elseif ('-' === $indicator) { - $text = preg_replace('/\n+$/s', '', $text); + $text = preg_replace('/\n+$/', '', $text); } return $text; @@ -647,7 +647,7 @@ private function cleanup($value) $value = $trimmedValue; // remove end of the document marker (...) - $value = preg_replace('#\.\.\.\s*$#s', '', $value); + $value = preg_replace('#\.\.\.\s*$#', '', $value); } return $value; diff --git a/core/vendor/symfony/yaml/Tests/InlineTest.php b/core/vendor/symfony/yaml/Tests/InlineTest.php index 320eb5072132..0776e4fa8dfb 100644 --- a/core/vendor/symfony/yaml/Tests/InlineTest.php +++ b/core/vendor/symfony/yaml/Tests/InlineTest.php @@ -50,15 +50,19 @@ public function testDumpNumericValueWithLocale() $this->markTestSkipped('Your platform does not support locales.'); } - $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); - if (false === setlocale(LC_ALL, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); + try { + $requiredLocales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); + if (false === setlocale(LC_NUMERIC, $requiredLocales)) { + $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $requiredLocales)); + } + + $this->assertEquals('1.2', Inline::dump(1.2)); + $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); + setlocale(LC_NUMERIC, $locale); + } catch (\Exception $e) { + setlocale(LC_NUMERIC, $locale); + throw $e; } - - $this->assertEquals('1.2', Inline::dump(1.2)); - $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_ALL, $locale); } public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF() diff --git a/core/vendor/symfony/yaml/Tests/YamlTest.php b/core/vendor/symfony/yaml/Tests/YamlTest.php index a7261562d539..8db65e399051 100644 --- a/core/vendor/symfony/yaml/Tests/YamlTest.php +++ b/core/vendor/symfony/yaml/Tests/YamlTest.php @@ -28,8 +28,6 @@ public function testParseAndDump() */ public function testLegacyParseFromFile() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $filename = __DIR__.'/Fixtures/index.yml'; $contents = file_get_contents($filename); $parsedByFilename = Yaml::parse($filename); -- GitLab