From 86dddd7b4cc1444178856065da7a5c6cc354a117 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 30 Nov 2014 21:18:40 +0000 Subject: [PATCH 1/2] Bumped the minimum php version to 5.5 --- .travis.yml | 3 --- README.md | 21 +------------------ autoload.php.dist | 6 +++--- composer.json | 3 +-- src/Symfony/Bridge/Doctrine/composer.json | 2 +- src/Symfony/Bridge/Monolog/composer.json | 2 +- src/Symfony/Bridge/Propel1/composer.json | 2 +- src/Symfony/Bridge/ProxyManager/composer.json | 2 +- src/Symfony/Bridge/Swiftmailer/composer.json | 2 +- src/Symfony/Bridge/Twig/composer.json | 2 +- src/Symfony/Bundle/DebugBundle/composer.json | 2 +- .../Bundle/FrameworkBundle/composer.json | 2 +- .../Bundle/SecurityBundle/composer.json | 2 +- src/Symfony/Bundle/TwigBundle/composer.json | 2 +- .../Bundle/WebProfilerBundle/composer.json | 2 +- .../Component/BrowserKit/composer.json | 2 +- .../Component/ClassLoader/composer.json | 2 +- src/Symfony/Component/Config/composer.json | 2 +- src/Symfony/Component/Console/composer.json | 2 +- .../Component/CssSelector/composer.json | 2 +- src/Symfony/Component/Debug/composer.json | 2 +- .../DependencyInjection/composer.json | 2 +- .../Component/DomCrawler/composer.json | 2 +- .../Component/EventDispatcher/composer.json | 2 +- .../ExpressionLanguage/composer.json | 2 +- .../Component/Filesystem/composer.json | 2 +- src/Symfony/Component/Finder/composer.json | 2 +- src/Symfony/Component/Form/composer.json | 2 +- .../Component/HttpFoundation/composer.json | 2 +- .../Component/HttpKernel/composer.json | 2 +- src/Symfony/Component/Intl/composer.json | 2 +- src/Symfony/Component/Locale/composer.json | 2 +- .../Component/OptionsResolver/composer.json | 2 +- src/Symfony/Component/Process/composer.json | 2 +- .../Component/PropertyAccess/composer.json | 2 +- src/Symfony/Component/Routing/composer.json | 2 +- .../Component/Security/Acl/composer.json | 2 +- .../Component/Security/Core/composer.json | 2 +- .../Component/Security/Csrf/composer.json | 2 +- .../Component/Security/Http/composer.json | 2 +- src/Symfony/Component/Security/composer.json | 6 ++---- .../Component/Serializer/composer.json | 2 +- src/Symfony/Component/Stopwatch/composer.json | 2 +- .../Component/Templating/composer.json | 2 +- .../Component/Translation/composer.json | 2 +- src/Symfony/Component/Validator/composer.json | 2 +- src/Symfony/Component/VarDumper/composer.json | 2 +- src/Symfony/Component/Yaml/composer.json | 2 +- 48 files changed, 50 insertions(+), 75 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9860cd03a92d1..0aaaa909716ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ language: php php: - - 5.3.3 - - 5.3 - - 5.4 - 5.5 - 5.6 - hhvm-nightly diff --git a/README.md b/README.md index 42607fbbfa434..2872679352fee 100644 --- a/README.md +++ b/README.md @@ -4,32 +4,13 @@ README What is Symfony? ----------------- -Symfony is a PHP 5.3 full-stack web framework. It is written with speed and +Symfony is a PHP 5.5 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP. Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers. -Requirements ------------- - -Symfony is only supported on PHP 5.3.3 and up. - -Be warned that PHP versions before 5.3.8 are known to be buggy and might not -work for you: - - * before PHP 5.3.4, if you get "Notice: Trying to get property of - non-object", you've hit a known PHP bug (see - https://bugs.php.net/bug.php?id=52083 and - https://bugs.php.net/bug.php?id=50027); - - * before PHP 5.3.8, if you get an error involving annotations, you've hit a - known PHP bug (see https://bugs.php.net/bug.php?id=55156). - - * PHP 5.3.16 has a major bug in the Reflection subsystem and is not suitable to - run Symfony (https://bugs.php.net/bug.php?id=62715) - Installation ------------ diff --git a/autoload.php.dist b/autoload.php.dist index 689f140d093f4..1902f1af46c5c 100644 --- a/autoload.php.dist +++ b/autoload.php.dist @@ -1,8 +1,8 @@ = 50400 && gc_enabled()) { - // Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+ - // https://bugs.php.net/bug.php?id=53976 +// Disabling Zend Garbage Collection to prevent segfaults +// https://bugs.php.net/bug.php?id=53976 +if (gc_enabled()) { gc_disable(); } diff --git a/composer.json b/composer.json index fa875605b20c2..aae678f1bb980 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "doctrine/common": "~2.2", "twig/twig": "~1.12", "psr/log": "~1.0" @@ -74,7 +74,6 @@ "doctrine/doctrine-bundle": "~1.2", "monolog/monolog": "~1.11", "propel/propel1": "~1.6", - "ircmaxell/password-compat": "~1.0", "ocramius/proxy-manager": "~0.4|~1.0", "egulias/email-validator": "~1.2" }, diff --git a/src/Symfony/Bridge/Doctrine/composer.json b/src/Symfony/Bridge/Doctrine/composer.json index 1c61595b78475..86c8cff9229b6 100644 --- a/src/Symfony/Bridge/Doctrine/composer.json +++ b/src/Symfony/Bridge/Doctrine/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "doctrine/common": "~2.2" }, "require-dev": { diff --git a/src/Symfony/Bridge/Monolog/composer.json b/src/Symfony/Bridge/Monolog/composer.json index f66bb561fb343..5645911c8ffd7 100644 --- a/src/Symfony/Bridge/Monolog/composer.json +++ b/src/Symfony/Bridge/Monolog/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "monolog/monolog": "~1.11" }, "require-dev": { diff --git a/src/Symfony/Bridge/Propel1/composer.json b/src/Symfony/Bridge/Propel1/composer.json index 7738cb0e93e22..68c154b2bbc42 100644 --- a/src/Symfony/Bridge/Propel1/composer.json +++ b/src/Symfony/Bridge/Propel1/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/http-foundation": "~2.0", "symfony/http-kernel": "~2.0", "symfony/form": "~2.2", diff --git a/src/Symfony/Bridge/ProxyManager/composer.json b/src/Symfony/Bridge/ProxyManager/composer.json index 856116caf4218..5d61d0fb76d5b 100644 --- a/src/Symfony/Bridge/ProxyManager/composer.json +++ b/src/Symfony/Bridge/ProxyManager/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/dependency-injection": "~2.3", "ocramius/proxy-manager": "~0.4|~1.0" }, diff --git a/src/Symfony/Bridge/Swiftmailer/composer.json b/src/Symfony/Bridge/Swiftmailer/composer.json index 470dd54f8148d..2e482490c3771 100644 --- a/src/Symfony/Bridge/Swiftmailer/composer.json +++ b/src/Symfony/Bridge/Swiftmailer/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "swiftmailer/swiftmailer": ">=4.2.0,<6.0-dev" }, "suggest": { diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index 4fd26da0d1865..c7522d9c1d5d2 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/security-csrf": "~2.4", "twig/twig": "~1.12" }, diff --git a/src/Symfony/Bundle/DebugBundle/composer.json b/src/Symfony/Bundle/DebugBundle/composer.json index 69cd5c153ea03..86e47dc23e0ea 100644 --- a/src/Symfony/Bundle/DebugBundle/composer.json +++ b/src/Symfony/Bundle/DebugBundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/http-kernel": "~2.6", "symfony/twig-bridge": "~2.6", "symfony/var-dumper": "~2.6" diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 9b6481969fe6c..e6c34260ebede 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/dependency-injection" : "~2.2", "symfony/config" : "~2.4", "symfony/event-dispatcher": "~2.5", diff --git a/src/Symfony/Bundle/SecurityBundle/composer.json b/src/Symfony/Bundle/SecurityBundle/composer.json index 1f67c8ba19416..db59159aaf688 100644 --- a/src/Symfony/Bundle/SecurityBundle/composer.json +++ b/src/Symfony/Bundle/SecurityBundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/security": "~2.6", "symfony/http-kernel": "~2.2" }, diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 45ee25d607dee..922678583db2a 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/twig-bridge": "~2.5", "symfony/http-foundation": "~2.5", "symfony/http-kernel": "~2.1" diff --git a/src/Symfony/Bundle/WebProfilerBundle/composer.json b/src/Symfony/Bundle/WebProfilerBundle/composer.json index 41e723019d70c..76b671ab3604f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/composer.json +++ b/src/Symfony/Bundle/WebProfilerBundle/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/http-kernel": "~2.3", "symfony/routing": "~2.2", "symfony/twig-bridge": "~2.2" diff --git a/src/Symfony/Component/BrowserKit/composer.json b/src/Symfony/Component/BrowserKit/composer.json index 277ab5144746d..7b540ca479c54 100644 --- a/src/Symfony/Component/BrowserKit/composer.json +++ b/src/Symfony/Component/BrowserKit/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/dom-crawler": "~2.0" }, "require-dev": { diff --git a/src/Symfony/Component/ClassLoader/composer.json b/src/Symfony/Component/ClassLoader/composer.json index 094844814ac3c..c9bb59f5f2c94 100644 --- a/src/Symfony/Component/ClassLoader/composer.json +++ b/src/Symfony/Component/ClassLoader/composer.json @@ -17,7 +17,7 @@ ], "minimum-stability": "dev", "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/finder": "~2.0" diff --git a/src/Symfony/Component/Config/composer.json b/src/Symfony/Component/Config/composer.json index 2da16c5620506..dc95c2f9bdd75 100644 --- a/src/Symfony/Component/Config/composer.json +++ b/src/Symfony/Component/Config/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/filesystem": "~2.3" }, "autoload": { diff --git a/src/Symfony/Component/Console/composer.json b/src/Symfony/Component/Console/composer.json index 0e7fdc9515d48..9d1dc759df989 100644 --- a/src/Symfony/Component/Console/composer.json +++ b/src/Symfony/Component/Console/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/event-dispatcher": "~2.1", diff --git a/src/Symfony/Component/CssSelector/composer.json b/src/Symfony/Component/CssSelector/composer.json index 12c782038e913..0b2f6ccea37c0 100644 --- a/src/Symfony/Component/CssSelector/composer.json +++ b/src/Symfony/Component/CssSelector/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\CssSelector\\": "" } diff --git a/src/Symfony/Component/Debug/composer.json b/src/Symfony/Component/Debug/composer.json index fa18b60ebcd1f..3ca3b7869e2bd 100644 --- a/src/Symfony/Component/Debug/composer.json +++ b/src/Symfony/Component/Debug/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "psr/log": "~1.0" }, "require-dev": { diff --git a/src/Symfony/Component/DependencyInjection/composer.json b/src/Symfony/Component/DependencyInjection/composer.json index c1d8c4560bf4a..c03a2f1a03289 100644 --- a/src/Symfony/Component/DependencyInjection/composer.json +++ b/src/Symfony/Component/DependencyInjection/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/yaml": "~2.0", diff --git a/src/Symfony/Component/DomCrawler/composer.json b/src/Symfony/Component/DomCrawler/composer.json index 2a04cf511cdd1..f0abd5ac03c89 100644 --- a/src/Symfony/Component/DomCrawler/composer.json +++ b/src/Symfony/Component/DomCrawler/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/css-selector": "~2.0" diff --git a/src/Symfony/Component/EventDispatcher/composer.json b/src/Symfony/Component/EventDispatcher/composer.json index 6ece50892d294..873440ef7fd49 100644 --- a/src/Symfony/Component/EventDispatcher/composer.json +++ b/src/Symfony/Component/EventDispatcher/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/dependency-injection": "~2.6", diff --git a/src/Symfony/Component/ExpressionLanguage/composer.json b/src/Symfony/Component/ExpressionLanguage/composer.json index 40f241bdcf9c0..4ed933dcaa04f 100644 --- a/src/Symfony/Component/ExpressionLanguage/composer.json +++ b/src/Symfony/Component/ExpressionLanguage/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\ExpressionLanguage\\": "" } diff --git a/src/Symfony/Component/Filesystem/composer.json b/src/Symfony/Component/Filesystem/composer.json index 33d4dd8466c92..9736bc7eefc08 100644 --- a/src/Symfony/Component/Filesystem/composer.json +++ b/src/Symfony/Component/Filesystem/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Filesystem\\": "" } diff --git a/src/Symfony/Component/Finder/composer.json b/src/Symfony/Component/Finder/composer.json index f1edff50204fe..1147fb638ce98 100644 --- a/src/Symfony/Component/Finder/composer.json +++ b/src/Symfony/Component/Finder/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Finder\\": "" } diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index 52aed058e3abe..02806456781f1 100644 --- a/src/Symfony/Component/Form/composer.json +++ b/src/Symfony/Component/Form/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/event-dispatcher": "~2.1", "symfony/intl": "~2.3", "symfony/options-resolver": "~2.1", diff --git a/src/Symfony/Component/HttpFoundation/composer.json b/src/Symfony/Component/HttpFoundation/composer.json index a6c8f51b8d8fd..64ebc19d6da13 100644 --- a/src/Symfony/Component/HttpFoundation/composer.json +++ b/src/Symfony/Component/HttpFoundation/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/expression-language": "~2.4" diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 778d239aee290..26c523ce14418 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/event-dispatcher": "~2.5", "symfony/http-foundation": "~2.5", "symfony/debug": "~2.6", diff --git a/src/Symfony/Component/Intl/composer.json b/src/Symfony/Component/Intl/composer.json index beca5c92363e3..364f52fe225d8 100644 --- a/src/Symfony/Component/Intl/composer.json +++ b/src/Symfony/Component/Intl/composer.json @@ -24,7 +24,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/filesystem": ">=2.1" diff --git a/src/Symfony/Component/Locale/composer.json b/src/Symfony/Component/Locale/composer.json index cc4fb2237a3f4..c2ddfdeeb6370 100644 --- a/src/Symfony/Component/Locale/composer.json +++ b/src/Symfony/Component/Locale/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/intl": ">=2.3" }, "autoload": { diff --git a/src/Symfony/Component/OptionsResolver/composer.json b/src/Symfony/Component/OptionsResolver/composer.json index 49a1607a1b7aa..5bb0806a8e355 100644 --- a/src/Symfony/Component/OptionsResolver/composer.json +++ b/src/Symfony/Component/OptionsResolver/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\OptionsResolver\\": "" } diff --git a/src/Symfony/Component/Process/composer.json b/src/Symfony/Component/Process/composer.json index 938b3987ab737..c8f481e5e2760 100644 --- a/src/Symfony/Component/Process/composer.json +++ b/src/Symfony/Component/Process/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Process\\": "" } diff --git a/src/Symfony/Component/PropertyAccess/composer.json b/src/Symfony/Component/PropertyAccess/composer.json index 796b736888182..f6d0b0f7ca04d 100644 --- a/src/Symfony/Component/PropertyAccess/composer.json +++ b/src/Symfony/Component/PropertyAccess/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\PropertyAccess\\": "" } diff --git a/src/Symfony/Component/Routing/composer.json b/src/Symfony/Component/Routing/composer.json index 8298506f3a20e..b52469243aeed 100644 --- a/src/Symfony/Component/Routing/composer.json +++ b/src/Symfony/Component/Routing/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/config": "~2.2", diff --git a/src/Symfony/Component/Security/Acl/composer.json b/src/Symfony/Component/Security/Acl/composer.json index a1a5d6a526b33..b7c4767efd787 100644 --- a/src/Symfony/Component/Security/Acl/composer.json +++ b/src/Symfony/Component/Security/Acl/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/security-core": "~2.4" }, "require-dev": { diff --git a/src/Symfony/Component/Security/Core/composer.json b/src/Symfony/Component/Security/Core/composer.json index f27b2c716ae8a..6fe8cb8ee49d8 100644 --- a/src/Symfony/Component/Security/Core/composer.json +++ b/src/Symfony/Component/Security/Core/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/event-dispatcher": "~2.1", diff --git a/src/Symfony/Component/Security/Csrf/composer.json b/src/Symfony/Component/Security/Csrf/composer.json index 16099a6e4e0c7..dcbce37a56011 100644 --- a/src/Symfony/Component/Security/Csrf/composer.json +++ b/src/Symfony/Component/Security/Csrf/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/security-core": "~2.4" }, "require-dev": { diff --git a/src/Symfony/Component/Security/Http/composer.json b/src/Symfony/Component/Security/Http/composer.json index 394267b3f0738..8d448000ad735 100644 --- a/src/Symfony/Component/Security/Http/composer.json +++ b/src/Symfony/Component/Security/Http/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/security-core": "~2.4", "symfony/event-dispatcher": "~2.1", "symfony/http-foundation": "~2.4", diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 0d48c5f2ba7d0..62302b9bd1923 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/event-dispatcher": "~2.1", "symfony/http-foundation": "~2.1", "symfony/http-kernel": "~2.4" @@ -33,7 +33,6 @@ "doctrine/common": "~2.2", "doctrine/dbal": "~2.2", "psr/log": "~1.0", - "ircmaxell/password-compat": "~1.0", "symfony/expression-language": "~2.4" }, "suggest": { @@ -42,8 +41,7 @@ "symfony/validator": "For using the user password constraint", "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", "doctrine/dbal": "For using the built-in ACL implementation", - "symfony/expression-language": "For using the expression voter", - "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5" + "symfony/expression-language": "For using the expression voter" }, "autoload": { "psr-0": { "Symfony\\Component\\Security\\": "" } diff --git a/src/Symfony/Component/Serializer/composer.json b/src/Symfony/Component/Serializer/composer.json index ca4407eed8870..c9018ecf90726 100644 --- a/src/Symfony/Component/Serializer/composer.json +++ b/src/Symfony/Component/Serializer/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Serializer\\": "" } diff --git a/src/Symfony/Component/Stopwatch/composer.json b/src/Symfony/Component/Stopwatch/composer.json index 99821957ffbbe..aa02d7ae0d780 100644 --- a/src/Symfony/Component/Stopwatch/composer.json +++ b/src/Symfony/Component/Stopwatch/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Stopwatch\\": "" } diff --git a/src/Symfony/Component/Templating/composer.json b/src/Symfony/Component/Templating/composer.json index 91defd0602213..22de64ddb48fc 100644 --- a/src/Symfony/Component/Templating/composer.json +++ b/src/Symfony/Component/Templating/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "psr/log": "~1.0" diff --git a/src/Symfony/Component/Translation/composer.json b/src/Symfony/Component/Translation/composer.json index b6d1e21f10039..a3253219addc0 100644 --- a/src/Symfony/Component/Translation/composer.json +++ b/src/Symfony/Component/Translation/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "require-dev": { "symfony/config": "~2.0", diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index c378ab7412e5b..38c528e7c6beb 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.5.0", "symfony/translation": "~2.0" }, "require-dev": { diff --git a/src/Symfony/Component/VarDumper/composer.json b/src/Symfony/Component/VarDumper/composer.json index 58560fbcb5426..147ede92938c4 100644 --- a/src/Symfony/Component/VarDumper/composer.json +++ b/src/Symfony/Component/VarDumper/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "suggest": { "ext-symfony_debug": "" diff --git a/src/Symfony/Component/Yaml/composer.json b/src/Symfony/Component/Yaml/composer.json index 1ca239845b934..96a140984061a 100644 --- a/src/Symfony/Component/Yaml/composer.json +++ b/src/Symfony/Component/Yaml/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5.0" }, "autoload": { "psr-0": { "Symfony\\Component\\Yaml\\": "" } From a6644d4277ec49c3d6dc3dabea47dfdc7c2dfdf9 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 15 Dec 2014 10:31:09 +0000 Subject: [PATCH 2/2] Removed some old hacks --- .../Bridge/Twig/Extension/CodeExtension.php | 6 +- .../Bridge/Twig/Tests/Node/FormThemeTest.php | 6 +- .../Node/SearchAndRenderBlockNodeTest.php | 6 +- .../Bridge/Twig/Tests/Node/TransNodeTest.php | 12 +- .../Command/ServerRunCommand.php | 2 +- .../DependencyInjection/Configuration.php | 9 +- .../Templating/Helper/CodeHelper.php | 6 +- .../Console/Descriptor/JsonDescriptorTest.php | 7 -- .../DependencyInjection/ConfigurationTest.php | 2 +- .../FrameworkExtensionTest.php | 18 +-- .../SecurityRoutingIntegrationTest.php | 8 -- .../ClassLoader/ClassMapGenerator.php | 10 +- .../Tests/ClassCollectionLoaderTest.php | 12 -- .../Tests/ClassMapGeneratorTest.php | 9 +- .../Console/Descriptor/TextDescriptor.php | 4 - src/Symfony/Component/Debug/ErrorHandler.php | 16 +-- .../Component/Debug/ExceptionHandler.php | 2 +- src/Symfony/Component/DomCrawler/Crawler.php | 10 +- .../Component/ExpressionLanguage/Parser.php | 4 - .../DateTimeToStringTransformer.php | 6 - .../Csrf/CsrfProvider/DefaultCsrfProvider.php | 6 +- .../DateTimeToStringTransformerTest.php | 10 +- .../CsrfProvider/DefaultCsrfProviderTest.php | 4 - .../Storage/Handler/NativeSessionHandler.php | 10 +- .../Session/Storage/NativeSessionStorage.php | 38 +----- .../Storage/PhpBridgeSessionStorage.php | 4 - .../Session/Storage/Proxy/AbstractProxy.php | 27 +---- .../Handler/NativeFileSessionHandlerTest.php | 9 +- .../Handler/NativeSessionHandlerTest.php | 11 +- .../Storage/NativeSessionStorageTest.php | 36 +----- .../Storage/PhpBridgeSessionStorageTest.php | 30 +---- .../Storage/Proxy/AbstractProxyTest.php | 77 +----------- .../Storage/Proxy/SessionHandlerProxyTest.php | 8 +- .../DataCollector/DumpDataCollector.php | 7 +- .../Fragment/HIncludeFragmentRenderer.php | 6 +- .../Controller/ControllerResolverTest.php | 14 +-- .../Data/Bundle/Writer/JsonBundleWriter.php | 12 +- .../Intl/DateFormatter/IntlDateFormatter.php | 33 ++---- .../Intl/NumberFormatter/NumberFormatter.php | 28 +---- .../Bundle/Writer/JsonBundleWriterTest.php | 8 -- .../AbstractIntlDateFormatterTest.php | 110 ++++-------------- .../DateFormatter/IntlDateFormatterTest.php | 7 +- .../AbstractNumberFormatterTest.php | 24 +--- .../Core/Encoder/BCryptPasswordEncoder.php | 4 - .../Encoder/BCryptPasswordEncoderTest.php | 11 -- .../Security/Core/Util/SecureRandom.php | 4 +- .../NativeSessionTokenStorageTest.php | 4 - .../NativeSessionTokenStorage.php | 6 +- .../Serializer/Encoder/JsonDecode.php | 6 +- .../Component/Templating/PhpEngine.php | 6 +- .../Tests/Dumper/JsonFileDumperTest.php | 4 - .../Validator/LegacyValidator2Dot5ApiTest.php | 9 -- .../LegacyValidatorLegacyApiTest.php | 9 -- .../Validator/Tests/ValidatorBuilderTest.php | 12 +- .../Component/Validator/ValidatorBuilder.php | 13 +-- .../Component/VarDumper/Cloner/VarCloner.php | 2 +- .../VarDumper/Tests/CliDumperTest.php | 2 +- .../VarDumper/Tests/HtmlDumperTest.php | 2 +- .../Yaml/Exception/ParseException.php | 7 +- .../Yaml/Tests/ParseExceptionTest.php | 12 +- 60 files changed, 97 insertions(+), 690 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php index 55a46f2e6f31b..10e3e162ed3ab 100644 --- a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php @@ -174,11 +174,7 @@ public function formatFile($file, $line, $text = null) $text = "$text at line $line"; if (false !== $link = $this->getFileLink($file, $line)) { - if (PHP_VERSION_ID >= 50400) { - $flags = ENT_QUOTES | ENT_SUBSTITUTE; - } else { - $flags = ENT_QUOTES; - } + $flags = ENT_QUOTES | ENT_SUBSTITUTE; return sprintf('%s', htmlspecialchars($link, $flags, $this->charset), $text); } diff --git a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php index 5f8ae112118fb..34b6de2a526ff 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php @@ -66,10 +66,6 @@ public function testCompile() protected function getVariableGetter($name) { - if (PHP_VERSION_ID >= 50400) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); - } - - return sprintf('$this->getContext($context, "%s")', $name); + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); } } diff --git a/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php index 60ef9edfb9751..e08572e60ca4e 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php @@ -263,10 +263,6 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes() protected function getVariableGetter($name) { - if (PHP_VERSION_ID >= 50400) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); - } - - return sprintf('$this->getContext($context, "%s")', $name); + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); } } diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php index df5eb559d8c21..476fc5fef1d7e 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php @@ -38,19 +38,11 @@ public function testCompileStrict() } protected function getVariableGetterWithoutStrictCheck($name) { - if (PHP_VERSION_ID >= 50400) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); - } - - return sprintf('$this->getContext($context, "%s", true)', $name); + return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); } protected function getVariableGetterWithStrictCheck($name) { - if (PHP_VERSION_ID >= 50400) { - return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name); - } - - return sprintf('$this->getContext($context, "%s")', $name); + return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php index 3b2efc139a2d5..bba4a2020784d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php @@ -30,7 +30,7 @@ class ServerRunCommand extends ContainerAwareCommand */ public function isEnabled() { - if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) { + if (defined('HHVM_VERSION')) { return false; } diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index ab9a3312c84d6..21d49b0b03c98 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -493,14 +493,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode) ->validate() ->ifTrue(function ($v) { return !isset($v['validation']['api']) || 'auto' === $v['validation']['api']; }) ->then(function ($v) { - // This condition is duplicated in ValidatorBuilder. This - // duplication is necessary in order to know the desired - // API version already during container configuration - // (to adjust service classes etc.) - // See https://github.com/symfony/symfony/issues/11580 - $v['validation']['api'] = PHP_VERSION_ID < 50309 - ? '2.4' - : '2.5-bc'; + $v['validation']['api'] = '2.5-bc'; return $v; }) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php index fe5ae49b2b074..60fa93cf6df22 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php @@ -166,11 +166,7 @@ public function formatFile($file, $line, $text = null) } if (false !== $link = $this->getFileLink($file, $line)) { - if (PHP_VERSION_ID >= 50400) { - $flags = ENT_QUOTES | ENT_SUBSTITUTE; - } else { - $flags = ENT_QUOTES; - } + $flags = ENT_QUOTES | ENT_SUBSTITUTE; return sprintf('%s', htmlspecialchars($link, $flags, $this->charset), $text); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/JsonDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/JsonDescriptorTest.php index 7f7a0ae15cfd7..ee03f65391f8a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/JsonDescriptorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/JsonDescriptorTest.php @@ -15,13 +15,6 @@ class JsonDescriptorTest extends AbstractDescriptorTest { - protected function setUp() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped on PHP 5.3 as JSON_PRETTY_PRINT does not exist.'); - } - } - protected function getDescriptor() { return new JsonDescriptor(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 9a4ad2770a442..0fdb592ca69d6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -131,7 +131,7 @@ protected static function getBundleDefaultConfig() 'static_method' => array('loadValidatorMetadata'), 'translation_domain' => 'validators', 'strict_email' => false, - 'api' => PHP_VERSION_ID < 50309 ? '2.4' : '2.5-bc', + 'api' => '2.5-bc', ), 'annotations' => array( 'cache' => 'file', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index acc3cff6ba41e..4c4f14a4fc259 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -295,11 +295,7 @@ public function testValidation() $this->assertEquals(array(new Reference('validator.mapping.cache.apc')), $calls[5][1]); $this->assertSame('setApiVersion', $calls[6][0]); - if (PHP_VERSION_ID < 50309) { - $this->assertEquals(array(Validation::API_VERSION_2_4), $calls[6][1]); - } else { - $this->assertEquals(array(Validation::API_VERSION_2_5_BC), $calls[6][1]); - } + $this->assertEquals(array(Validation::API_VERSION_2_5_BC), $calls[6][1]); } public function testFullyConfiguredValidationService() @@ -448,11 +444,7 @@ public function testValidationImplicitApi() $this->assertSame('setApiVersion', $calls[5][0]); // no cache, no annotations - if (PHP_VERSION_ID < 50309) { - $this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]); - } else { - $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); - } + $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); } /** @@ -472,11 +464,7 @@ public function testValidationAutoApi() $this->assertSame('setApiVersion', $calls[5][0]); // no cache, no annotations - if (PHP_VERSION_ID < 50309) { - $this->assertSame(array(Validation::API_VERSION_2_4), $calls[5][1]); - } else { - $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); - } + $this->assertSame(array(Validation::API_VERSION_2_5_BC), $calls[5][1]); } public function testFormsCanBeEnabledWithoutCsrfProtection() diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index f86ec326afa55..3593b5074314d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -30,10 +30,6 @@ public function testRoutingErrorIsNotExposedForProtectedResourceWhenAnonymous($c */ public function testRoutingErrorIsExposedWhenNotProtected($config) { - if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366'); - } - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); $client->insulate(); $client->request('GET', '/unprotected_resource'); @@ -46,10 +42,6 @@ public function testRoutingErrorIsExposedWhenNotProtected($config) */ public function testRoutingErrorIsNotExposedForProtectedResourceWhenLoggedInWithInsufficientRights($config) { - if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366'); - } - $client = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config)); $client->insulate(); diff --git a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php index e9a93e118c197..9a37126003305 100644 --- a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php +++ b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php @@ -11,14 +11,6 @@ namespace Symfony\Component\ClassLoader; -if (!defined('SYMFONY_TRAIT')) { - if (PHP_VERSION_ID >= 50400) { - define('SYMFONY_TRAIT', T_TRAIT); - } else { - define('SYMFONY_TRAIT', 0); - } -} - /** * ClassMapGenerator * @@ -117,7 +109,7 @@ private static function findClasses($path) break; case T_CLASS: case T_INTERFACE: - case SYMFONY_TRAIT: + case T_TRAIT: // Find the classname while (($t = $tokens[++$i]) && is_array($t)) { if (T_STRING === $t[0]) { diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php index e821e45063631..24b59bf8bad49 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php @@ -22,12 +22,6 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase { public function testTraitDependencies() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Requires PHP > 5.4'); - - return; - } - require_once __DIR__.'/Fixtures/deps/traits.php'; $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); @@ -100,12 +94,6 @@ public function getDifferentOrders() */ public function testClassWithTraitsReordering(array $classes) { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Requires PHP > 5.4'); - - return; - } - require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php'; require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php'; require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php'; diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php index 9853bcb08ec87..7b529efb6f717 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php @@ -102,18 +102,15 @@ public function getTestCreateMapTests() 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php', 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php', )), - ); - - if (PHP_VERSION_ID >= 50400) { - $data[] = array(__DIR__.'/Fixtures/php5.4', array( + array(__DIR__.'/Fixtures/php5.4', array( 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php', 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php', 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php', - )); - } + )), + ); return $data; } diff --git a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php index fcefcd83f68a9..1ed60e1073b4f 100644 --- a/src/Symfony/Component/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Component/Console/Descriptor/TextDescriptor.php @@ -229,10 +229,6 @@ private function writeText($content, array $options = array()) */ private function formatDefaultValue($default) { - if (PHP_VERSION_ID < 50400) { - return str_replace('\/', '/', json_encode($default)); - } - return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index 48e4a2d69e737..54a00eb08cff1 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -357,12 +357,6 @@ public function handleError($type, $message, $file, $line, array $context) $type &= $level | $this->screamedErrors; if ($type && ($log || $throw)) { - if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS']) && ($this->scopedErrors & $type)) { - $e = $context; // Whatever the signature of the method, - unset($e['GLOBALS'], $context); // $context is always a reference in 5.3 - $context = $e; - } - 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 @@ -371,14 +365,6 @@ public function handleError($type, $message, $file, $line, array $context) $throw = new \ErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line); } - if (PHP_VERSION_ID <= 50407 && (PHP_VERSION_ID >= 50400 || PHP_VERSION_ID <= 50317)) { - // Exceptions thrown from error handlers are sometimes not caught by the exception - // handler and shutdown handlers are bypassed before 5.4.8/5.3.18. - // We temporarily re-enable display_errors to prevent any blank page related to this bug. - - $throw->errorHandlerCanary = new ErrorHandlerCanary(); - } - throw $throw; } @@ -401,7 +387,7 @@ public function handleError($type, $message, $file, $line, array $context) $e['stack'] = debug_backtrace(true); // Provide object } } elseif ($trace) { - $e['stack'] = debug_backtrace(PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_IGNORE_ARGS : false); + $e['stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } } diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 9812729071e47..0f1ab169dc26d 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -424,7 +424,7 @@ protected static function utf8Htmlize($str) $str = iconv($charset, 'UTF-8', $str); } - return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8'); + return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } /** diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index 818220b42a40b..fd1d96af499c2 100755 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -575,15 +575,7 @@ public function html() $html = ''; foreach ($this->getNode(0)->childNodes as $child) { - if (PHP_VERSION_ID >= 50306) { - // node parameter was added to the saveHTML() method in PHP 5.3.6 - // @see http://php.net/manual/en/domdocument.savehtml.php - $html .= $child->ownerDocument->saveHTML($child); - } else { - $document = new \DOMDocument('1.0', 'UTF-8'); - $document->appendChild($document->importNode($child, true)); - $html .= rtrim($document->saveHTML()); - } + $html .= $child->ownerDocument->saveHTML($child); } return $html; diff --git a/src/Symfony/Component/ExpressionLanguage/Parser.php b/src/Symfony/Component/ExpressionLanguage/Parser.php index 3e769c6d4fb24..be884414a2ada 100644 --- a/src/Symfony/Component/ExpressionLanguage/Parser.php +++ b/src/Symfony/Component/ExpressionLanguage/Parser.php @@ -336,10 +336,6 @@ public function parsePostfixExpression($node) $node = new Node\GetAttrNode($node, $arg, $arguments, $type); } elseif ('[' === $token->value) { - if ($node instanceof Node\GetAttrNode && Node\GetAttrNode::METHOD_CALL === $node->attributes['type'] && PHP_VERSION_ID < 50400) { - throw new SyntaxError('Array calls on a method call is only supported on PHP 5.4+', $token->cursor); - } - $this->stream->next(); $arg = $this->parseExpression(); $this->stream->expect(Token::PUNCTUATION_TYPE, ']'); diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php index 4dd3a03bbca64..1f839a8a9648d 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php @@ -66,12 +66,6 @@ public function __construct($inputTimezone = null, $outputTimezone = null, $form $this->generateFormat = $this->parseFormat = $format; - // The pipe in the parser pattern only works as of PHP 5.3.7 - // See http://bugs.php.net/54316 - $this->parseUsingPipe = null === $parseUsingPipe - ? PHP_VERSION_ID >= 50307 - : $parseUsingPipe; - // See http://php.net/manual/en/datetime.createfromformat.php // The character "|" in the format makes sure that the parts of a date // that are *not* specified in the format are reset to the corresponding diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php index 7e38d22f23d5b..80c59e8aaae13 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php @@ -70,11 +70,7 @@ public function isCsrfTokenValid($intention, $token) */ protected function getSessionId() { - if (PHP_VERSION_ID >= 50400) { - if (PHP_SESSION_NONE === session_status()) { - session_start(); - } - } elseif (!session_id()) { + if (PHP_SESSION_NONE === session_status()) { session_start(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php index dbcdad0f96bdf..be0f451a90f9b 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php @@ -30,6 +30,7 @@ public function dataProvider() array('H:i:00', '16:05:00', '1970-01-01 16:05:00 UTC'), array('H:i', '16:05', '1970-01-01 16:05:00 UTC'), array('H', '16', '1970-01-01 16:00:00 UTC'), + array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC'), // different day representations array('Y-m-j', '2010-02-3', '2010-02-03 00:00:00 UTC'), @@ -59,11 +60,6 @@ public function dataProvider() array('U', '1265213106', '2010-02-03 16:05:06 UTC'), ); - // This test will fail < 5.3.9 - see https://bugs.php.net/51994 - if (PHP_VERSION_ID >= 50309) { - $data[] = array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC'); - } - return $data; } @@ -111,10 +107,6 @@ public function testTransformExpectsDateTime() */ public function testReverseTransformUsingPipe($format, $input, $output) { - if (PHP_VERSION_ID < 50307) { - $this->markTestSkipped('Pipe usage requires PHP 5.3.7 or newer.'); - } - $reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format, true); $output = new \DateTime($output); diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php index 3cf62f8db3081..103acf51712aa 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php @@ -49,10 +49,6 @@ public function testGenerateCsrfTokenOnUnstartedSession() { session_id('touti'); - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('This test requires PHP >= 5.4'); - } - $this->assertSame(PHP_SESSION_NONE, session_status()); $token = $this->provider->generateCsrfToken('foo'); diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php index 0319e0f802fab..047c70a2d9d5c 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php @@ -17,12 +17,6 @@ * @see http://php.net/sessionhandler */ -if (PHP_VERSION_ID >= 50400) { - class NativeSessionHandler extends \SessionHandler - { - } -} else { - class NativeSessionHandler - { - } +class NativeSessionHandler extends \SessionHandler +{ } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index 7a0c7a85e4a7b..0acefc281c549 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -100,11 +100,7 @@ public function __construct(array $options = array(), $handler = null, MetadataB session_cache_limiter(''); // disable by default because it's managed by HeaderBag (if used) ini_set('session.use_cookies', 1); - if (PHP_VERSION_ID >= 50400) { - session_register_shutdown(); - } else { - register_shutdown_function('session_write_close'); - } + session_register_shutdown(); $this->setMetadataBag($metaBag); $this->setOptions($options); @@ -130,15 +126,10 @@ public function start() return true; } - if (PHP_VERSION_ID >= 50400 && \PHP_SESSION_ACTIVE === session_status()) { + if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } - if (PHP_VERSION_ID < 50400 && !$this->closed && isset($_SESSION) && session_id()) { - // not 100% fool-proof, but is the most reliable way to determine if a session is active in PHP 5.3 - throw new \RuntimeException('Failed to start the session: already started by PHP ($_SESSION is set).'); - } - if (ini_get('session.use_cookies') && headers_sent($file, $line)) { throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); } @@ -149,10 +140,6 @@ public function start() } $this->loadSession(); - if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { - // This condition matches only PHP 5.3 with internal save handlers - $this->saveHandler->setActive(true); - } return true; } @@ -212,11 +199,6 @@ public function save() { session_write_close(); - if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { - // This condition matches only PHP 5.3 with internal save handlers - $this->saveHandler->setActive(false); - } - $this->closed = true; $this->started = false; } @@ -362,24 +344,12 @@ public function setSaveHandler($saveHandler = null) if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) { $saveHandler = new SessionHandlerProxy($saveHandler); } elseif (!$saveHandler instanceof AbstractProxy) { - $saveHandler = PHP_VERSION_ID >= 50400 ? - new SessionHandlerProxy(new \SessionHandler()) : new NativeProxy(); + $saveHandler = new SessionHandlerProxy(new \SessionHandler()); } $this->saveHandler = $saveHandler; if ($this->saveHandler instanceof \SessionHandlerInterface) { - if (PHP_VERSION_ID >= 50400) { - session_set_save_handler($this->saveHandler, false); - } else { - session_set_save_handler( - array($this->saveHandler, 'open'), - array($this->saveHandler, 'close'), - array($this->saveHandler, 'read'), - array($this->saveHandler, 'write'), - array($this->saveHandler, 'destroy'), - array($this->saveHandler, 'gc') - ); - } + session_set_save_handler($this->saveHandler, false); } } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php index 6554578c6dce4..3556db7261a24 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php @@ -43,10 +43,6 @@ public function start() } $this->loadSession(); - if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { - // This condition matches only PHP 5.3 + internal save handlers - $this->saveHandler->setActive(true); - } return true; } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php index 1036818277e1f..d80ba640f705e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php @@ -72,32 +72,7 @@ public function isWrapper() */ public function isActive() { - if (PHP_VERSION_ID >= 50400) { - return $this->active = \PHP_SESSION_ACTIVE === session_status(); - } - - return $this->active; - } - - /** - * Sets the active flag. - * - * Has no effect under PHP 5.4+ as status is detected - * automatically in isActive() - * - * @internal - * - * @param bool $flag - * - * @throws \LogicException - */ - public function setActive($flag) - { - if (PHP_VERSION_ID >= 50400) { - throw new \LogicException('This method is disabled in PHP 5.4.0+'); - } - - $this->active = (bool) $flag; + return $this->active = \PHP_SESSION_ACTIVE === session_status(); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php index 3f96bdf025732..493acd2ba742b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php @@ -27,13 +27,8 @@ public function testConstruct() { $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir())); - if (PHP_VERSION_ID < 50400) { - $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('files', ini_get('session.save_handler')); - } else { - $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); - $this->assertEquals('user', ini_get('session.save_handler')); - } + $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); + $this->assertEquals('user', ini_get('session.save_handler')); $this->assertEquals(sys_get_temp_dir(), ini_get('session.save_path')); $this->assertEquals('TESTING', ini_get('session.name')); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php index 8fba843b7dd56..70afdaadd4957 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php @@ -26,14 +26,7 @@ public function testConstruct() { $handler = new NativeSessionHandler(); - // note for PHPUnit optimisers - the use of assertTrue/False - // here is deliberate since the tests do not require the classes to exist - drak - if (PHP_VERSION_ID < 50400) { - $this->assertFalse($handler instanceof \SessionHandler); - $this->assertTrue($handler instanceof NativeSessionHandler); - } else { - $this->assertTrue($handler instanceof \SessionHandler); - $this->assertTrue($handler instanceof NativeSessionHandler); - } + $this->assertTrue($handler instanceof \SessionHandler); + $this->assertTrue($handler instanceof NativeSessionHandler); } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index e74f52cb3b1ea..57bfc285b8eaa 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -164,34 +164,8 @@ public function testSetSaveHandlerException() $storage->setSaveHandler(new \stdClass()); } - public function testSetSaveHandler53() + public function testSetSaveHandler() { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - ini_set('session.save_handler', 'files'); - $storage = $this->getStorage(); - $storage->setSaveHandler(); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(null); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(new NativeSessionHandler()); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(new SessionHandlerProxy(new NullSessionHandler())); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(new NullSessionHandler()); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(new NativeProxy()); - $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); - } - - public function testSetSaveHandler54() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } - ini_set('session.save_handler', 'files'); $storage = $this->getStorage(); $storage->setSaveHandler(); @@ -211,7 +185,7 @@ public function testSetSaveHandler54() /** * @expectedException \RuntimeException */ - public function testStartedOutside() + public function testStarted() { $storage = $this->getStorage(); @@ -221,10 +195,8 @@ public function testStartedOutside() session_start(); $this->assertTrue(isset($_SESSION)); - if (PHP_VERSION_ID >= 50400) { - // this only works in PHP >= 5.4 where session_status is available - $this->assertTrue($storage->getSaveHandler()->isActive()); - } + $this->assertTrue($storage->getSaveHandler()->isActive()); + // PHP session might have started, but the storage driver has not, so false is correct here $this->assertFalse($storage->isStarted()); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php index e712632589bf6..f88f73ff6e11f 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php @@ -58,36 +58,8 @@ protected function getStorage() return $storage; } - public function testPhpSession53() + public function testPhpSession() { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - $storage = $this->getStorage(); - - $this->assertFalse(isset($_SESSION)); - $this->assertFalse($storage->getSaveHandler()->isActive()); - - session_start(); - $this->assertTrue(isset($_SESSION)); - // in PHP 5.3 we cannot reliably tell if a session has started - $this->assertFalse($storage->getSaveHandler()->isActive()); - // PHP session might have started, but the storage driver has not, so false is correct here - $this->assertFalse($storage->isStarted()); - - $key = $storage->getMetadataBag()->getStorageKey(); - $this->assertFalse(isset($_SESSION[$key])); - $storage->start(); - $this->assertTrue(isset($_SESSION[$key])); - } - - public function testPhpSession54() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } - $storage = $this->getStorage(); $this->assertFalse(isset($_SESSION)); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php index 1df28cf1a2c92..eae226aadf253 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php @@ -85,54 +85,17 @@ public function testIsWrapper() $this->assertFalse($this->proxy->isWrapper()); } - public function testIsActivePhp53() - { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - $this->assertFalse($this->proxy->isActive()); - } - /** * @runInSeparateProcess */ - public function testIsActivePhp54() + public function testIsActive() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } $this->assertFalse($this->proxy->isActive()); session_start(); $this->assertTrue($this->proxy->isActive()); } - public function testSetActivePhp53() - { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - $this->proxy->setActive(true); - $this->assertTrue($this->proxy->isActive()); - $this->proxy->setActive(false); - $this->assertFalse($this->proxy->isActive()); - } - - /** - * @runInSeparateProcess - * @expectedException \LogicException - */ - public function testSetActivePhp54() - { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } - - $this->proxy->setActive(true); - } - /** * @runInSeparateProcess */ @@ -144,29 +107,12 @@ public function testName() $this->assertEquals(session_name(), $this->proxy->getName()); } - /** - * @expectedException \LogicException - */ - public function testNameExceptionPhp53() - { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - $this->proxy->setActive(true); - $this->proxy->setName('foo'); - } - /** * @runInSeparateProcess * @expectedException \LogicException */ - public function testNameExceptionPhp54() + public function testNameException() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } - session_start(); $this->proxy->setName('foo'); } @@ -182,29 +128,12 @@ public function testId() $this->assertEquals(session_id(), $this->proxy->getId()); } - /** - * @expectedException \LogicException - */ - public function testIdExceptionPhp53() - { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); - } - - $this->proxy->setActive(true); - $this->proxy->setId('foo'); - } - /** * @runInSeparateProcess * @expectedException \LogicException */ - public function testIdExceptionPhp54() + public function testIdException() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4 only.'); - } - session_start(); $this->proxy->setId('foo'); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php index be9b110d02e10..d417c84117ffd 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php @@ -44,7 +44,7 @@ protected function tearDown() $this->proxy = null; } - public function testOpen() + public function testOpenTrue() { $this->mock->expects($this->once()) ->method('open') @@ -52,11 +52,7 @@ public function testOpen() $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); - if (PHP_VERSION_ID < 50400) { - $this->assertTrue($this->proxy->isActive()); - } else { - $this->assertFalse($this->proxy->isActive()); - } + $this->assertFalse($this->proxy->isActive()); } public function testOpenFalse() diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index 6099097f366bd..8a836da84c5ab 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -60,12 +60,7 @@ public function dump(Data $data) $this->isCollected = false; } - $trace = PHP_VERSION_ID >= 50306 ? DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS : true; - if (PHP_VERSION_ID >= 50400) { - $trace = debug_backtrace($trace, 7); - } else { - $trace = debug_backtrace($trace); - } + $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 7); $file = $trace[0]['file']; $line = $trace[0]['line']; diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index 56c96b3ceda3f..304b527842445 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -107,11 +107,7 @@ public function render($uri, Request $request, array $options = array()) } $renderedAttributes = ''; if (count($attributes) > 0) { - if (PHP_VERSION_ID >= 50400) { - $flags = ENT_QUOTES | ENT_SUBSTITUTE; - } else { - $flags = ENT_QUOTES; - } + $flags = ENT_QUOTES | ENT_SUBSTITUTE; foreach ($attributes as $attribute => $value) { $renderedAttributes .= sprintf( ' %s="%s"', diff --git a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php index fe70ae5d5e844..dd1d6242eaa3a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php @@ -181,15 +181,11 @@ public function testGetArguments() $request->attributes->set('foobar', 'foobar'); $controller = array(new self(), 'controllerMethod3'); - if (PHP_VERSION_ID === 50316) { - $this->markTestSkipped('PHP 5.3.16 has a major bug in the Reflection sub-system'); - } else { - try { - $resolver->getArguments($request, $controller); - $this->fail('->getArguments() throws a \RuntimeException exception if it cannot determine the argument value'); - } catch (\Exception $e) { - $this->assertInstanceOf('\RuntimeException', $e, '->getArguments() throws a \RuntimeException exception if it cannot determine the argument value'); - } + try { + $resolver->getArguments($request, $controller); + $this->fail('->getArguments() throws a \RuntimeException exception if it cannot determine the argument value'); + } catch (\Exception $e) { + $this->assertInstanceOf('\RuntimeException', $e, '->getArguments() throws a \RuntimeException exception if it cannot determine the argument value'); } $request = Request::create('/'); diff --git a/src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php b/src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php index 6a79340c695e4..f3df769e13cc6 100644 --- a/src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php +++ b/src/Symfony/Component/Intl/Data/Bundle/Writer/JsonBundleWriter.php @@ -35,14 +35,8 @@ public function write($path, $locale, $data) } }); - if (PHP_VERSION_ID >= 50400) { - // Use JSON_PRETTY_PRINT so that we can see what changed in Git diffs - file_put_contents( - $path.'/'.$locale.'.json', - json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n" - ); - } else { - file_put_contents($path.'/'.$locale.'.json', json_encode($data)."\n"); - } + $contents = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n"; + + file_put_contents($path.'/'.$locale.'.json', $contents); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php index 4c7c11e6c8caa..b4ce8a5bf7894 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -185,10 +185,9 @@ public static function create($locale, $datetype, $timetype, $timezone = null, $ } /** - * Format the date/time value (timestamp) as a string + * Format the date/time value (timestamp) as a string. * - * @param int|\DateTime $timestamp The timestamp to format. \DateTime objects - * are supported as of PHP 5.3.4. + * @param int|\DateTime $timestamp The timestamp to format. * * @return string|bool The formatted value or false if formatting failed. * @@ -200,20 +199,16 @@ public function format($timestamp) { // intl allows timestamps to be passed as arrays - we don't if (is_array($timestamp)) { - $message = PHP_VERSION_ID >= 50304 ? - 'Only integer Unix timestamps and DateTime objects are supported' : - 'Only integer Unix timestamps are supported'; + $message = 'Only integer Unix timestamps and DateTime objects are supported'; throw new MethodArgumentValueNotImplementedException(__METHOD__, 'timestamp', $timestamp, $message); } // behave like the intl extension $argumentError = null; - if (PHP_VERSION_ID < 50304 && !is_int($timestamp)) { - $argumentError = 'datefmt_format: takes either an array or an integer timestamp value '; - } elseif (PHP_VERSION_ID >= 50304 && !is_int($timestamp) && !$timestamp instanceof \DateTime) { + if (!is_int($timestamp) && !$timestamp instanceof \DateTime) { $argumentError = 'datefmt_format: takes either an array or an integer timestamp value or a DateTime object'; - if (PHP_VERSION_ID >= 50500 && !is_int($timestamp)) { + if (!is_int($timestamp)) { $argumentError = sprintf('datefmt_format: string \'%s\' is not numeric, which would be required for it to be a valid date', $timestamp); } } @@ -227,7 +222,7 @@ public function format($timestamp) } // As of PHP 5.3.4, IntlDateFormatter::format() accepts DateTime instances - if (PHP_VERSION_ID >= 50304 && $timestamp instanceof \DateTime) { + if ($timestamp instanceof \DateTime) { $timestamp = $timestamp->getTimestamp(); } @@ -375,10 +370,7 @@ public function getTimeZoneId() return $this->timeZoneId; } - // In PHP 5.5 default timezone depends on `date_default_timezone_get()` method - if (PHP_VERSION_ID >= 50500) { - return date_default_timezone_get(); - } + return date_default_timezone_get(); } /** @@ -540,16 +532,7 @@ public function setPattern($pattern) public function setTimeZoneId($timeZoneId) { if (null === $timeZoneId) { - // In PHP 5.5 if $timeZoneId is null it fallbacks to `date_default_timezone_get()` method - if (PHP_VERSION_ID >= 50500) { - $timeZoneId = date_default_timezone_get(); - } else { - // TODO: changes were made to ext/intl in PHP 5.4.4 release that need to be investigated since it will - // use ini's date.timezone when the time zone is not provided. As a not well tested workaround, uses UTC. - // See the first two items of the commit message for more information: - // https://github.com/php/php-src/commit/eb346ef0f419b90739aadfb6cc7b7436c5b521d9 - $timeZoneId = getenv('TZ') ?: 'UTC'; - } + $timeZoneId = date_default_timezone_get(); $this->unitializedTimeZoneId = true; } diff --git a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php index 87e0bb3205573..9d0493e4f4f0b 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -839,9 +839,7 @@ private function getInt32Value($value) * * @param mixed $value The value to be converted * - * @return int|float The converted value - * - * @see https://bugs.php.net/bug.php?id=59597 Bug #59597 + * @return int| The converted value */ private function getInt64Value($value) { @@ -849,30 +847,6 @@ private function getInt64Value($value) return false; } - if (PHP_INT_SIZE !== 8 && ($value > self::$int32Range['positive'] || $value <= self::$int32Range['negative'])) { - // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4 - // The negative PHP_INT_MAX was being converted to float - if ( - $value == self::$int32Range['negative'] && - ((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404) - ) { - return (int) $value; - } - - return (float) $value; - } - - if (PHP_INT_SIZE === 8) { - // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4 - // A 32 bit integer was being generated instead of a 64 bit integer - if ( - ($value > self::$int32Range['positive'] || $value < self::$int32Range['negative']) && - (PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) - ) { - $value = (-2147483648 - ($value % -2147483648)) * ($value / abs($value)); - } - } - return (int) $value; } diff --git a/src/Symfony/Component/Intl/Tests/Data/Bundle/Writer/JsonBundleWriterTest.php b/src/Symfony/Component/Intl/Tests/Data/Bundle/Writer/JsonBundleWriterTest.php index 69575289cdd9f..f2e7b4fce46a5 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Bundle/Writer/JsonBundleWriterTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Bundle/Writer/JsonBundleWriterTest.php @@ -34,10 +34,6 @@ class JsonBundleWriterTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('This test requires at least PHP 5.4.0.'); - } - $this->writer = new JsonBundleWriter(); $this->directory = sys_get_temp_dir().'/JsonBundleWriterTest/'.rand(1000, 9999); $this->filesystem = new Filesystem(); @@ -47,10 +43,6 @@ protected function setUp() protected function tearDown() { - if (PHP_VERSION_ID < 50400) { - return; - } - $this->filesystem->remove($this->directory); } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php index 62fa6ea8d0daa..78e188889b6cc 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php @@ -36,12 +36,7 @@ public function testConstructorDefaultTimeZone() { $formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); - // In PHP 5.5 default timezone depends on `date_default_timezone_get()` method - if (PHP_VERSION_ID >= 50500) { - $this->assertEquals(date_default_timezone_get(), $formatter->getTimeZoneId()); - } else { - $this->assertNull($formatter->getTimeZoneId()); - } + $this->assertEquals(date_default_timezone_get(), $formatter->getTimeZoneId()); } /** @@ -59,6 +54,8 @@ public function testFormat($pattern, $timestamp, $expected) public function formatProvider() { + $dateTime = new \DateTime('@0'); + $formatData = array( /* general */ array('y-M-d', 0, '1970-1-1'), @@ -235,21 +232,15 @@ public function formatProvider() array('zzz', 0, 'GMT'), array('zzzz', 0, 'GMT'), array('zzzzz', 0, 'GMT'), - ); - - // As of PHP 5.3.4, IntlDateFormatter::format() accepts DateTime instances - if (PHP_VERSION_ID >= 50304) { - $dateTime = new \DateTime('@0'); - - /* general, DateTime */ - $formatData[] = array('y-M-d', $dateTime, '1970-1-1'); - $formatData[] = array("EEE, MMM d, ''yy", $dateTime, "Thu, Jan 1, '70"); - $formatData[] = array('h:mm a', $dateTime, '12:00 AM'); - $formatData[] = array('yyyyy.MMMM.dd hh:mm aaa', $dateTime, '01970.January.01 12:00 AM'); - $formatData[] = array("yyyy.MM.dd 'at' HH:mm:ss zzz", $dateTime, '1970.01.01 at 00:00:00 GMT'); - $formatData[] = array('K:mm a, z', $dateTime, '0:00 AM, GMT'); - } + // general, DateTime + array('y-M-d', $dateTime, '1970-1-1'), + array("EEE, MMM d, ''yy", $dateTime, "Thu, Jan 1, '70"), + array('h:mm a', $dateTime, '12:00 AM'), + array('yyyyy.MMMM.dd hh:mm aaa', $dateTime, '01970.January.01 12:00 AM'), + array("yyyy.MM.dd 'at' HH:mm:ss zzz", $dateTime, '1970.01.01 at 00:00:00 GMT'), + array('K:mm a, z', $dateTime, '0:00 AM, GMT'), + ); return $formatData; } @@ -268,22 +259,8 @@ public function testFormatIllegalArgumentError($pattern, $timestamp, $errorMessa public function formatErrorProvider() { - // With PHP 5.5 IntlDateFormatter accepts empty values ('0') - if (PHP_VERSION_ID >= 50500) { - return array( - array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR'), - ); - } - - $message = 'datefmt_format: takes either an array or an integer timestamp value : U_ILLEGAL_ARGUMENT_ERROR'; - - if (PHP_VERSION_ID >= 50304) { - $message = 'datefmt_format: takes either an array or an integer timestamp value or a DateTime object: U_ILLEGAL_ARGUMENT_ERROR'; - } - return array( - array('y-M-d', '0', $message), - array('y-M-d', 'foobar', $message), + array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR'), ); } @@ -323,16 +300,12 @@ public function formatWithTimezoneProvider() array(0, 'Europe/Dublin', '1970-01-01 01:00:00'), array(0, 'Europe/Warsaw', '1970-01-01 01:00:00'), array(0, 'Pacific/Fiji', '1970-01-01 12:00:00'), + array(0, 'Foo/Bar', '1970-01-01 00:00:00'), + array(0, 'Foo/Bar', '1970-01-01 00:00:00'), + array(0, 'UTC+04:30', '1970-01-01 00:00:00'), + array(0, 'UTC+04:AA', '1970-01-01 00:00:00'), ); - // As of PHP 5.5, intl ext no longer fallbacks invalid time zones to UTC - if (PHP_VERSION_ID < 50500) { - // When time zone not exists, uses UTC by default - $data[] = array(0, 'Foo/Bar', '1970-01-01 00:00:00'); - $data[] = array(0, 'UTC+04:30', '1970-01-01 00:00:00'); - $data[] = array(0, 'UTC+04:AA', '1970-01-01 00:00:00'); - } - return $data; } @@ -340,11 +313,7 @@ public function testFormatWithGmtTimezone() { $formatter = $this->getDefaultDateFormatter('zzzz'); - if (PHP_VERSION_ID >= 50500) { - $formatter->setTimeZone('GMT+03:00'); - } else { - $formatter->setTimeZoneId('GMT+03:00'); - } + $formatter->setTimeZone('GMT+03:00'); $this->assertEquals('GMT+03:00', $formatter->format(0)); } @@ -353,11 +322,7 @@ public function testFormatWithGmtTimeZoneAndMinutesOffset() { $formatter = $this->getDefaultDateFormatter('zzzz'); - if (PHP_VERSION_ID >= 50500) { - $formatter->setTimeZone('GMT+00:30'); - } else { - $formatter->setTimeZoneId('GMT+00:30'); - } + $formatter->setTimeZone('GMT+00:30'); $this->assertEquals('GMT+00:30', $formatter->format(0)); } @@ -366,11 +331,7 @@ public function testFormatWithNonStandardTimezone() { $formatter = $this->getDefaultDateFormatter('zzzz'); - if (PHP_VERSION_ID >= 50500) { - $formatter->setTimeZone('Pacific/Fiji'); - } else { - $formatter->setTimeZoneId('Pacific/Fiji'); - } + $formatter->setTimeZone('Pacific/Fiji'); $this->assertEquals('Fiji Standard Time', $formatter->format(0)); } @@ -386,35 +347,8 @@ public function testFormatWithConstructorTimezone() ); } - public function testFormatWithTimezoneFromEnvironmentVariable() - { - if (PHP_VERSION_ID >= 50500) { - $this->markTestSkipped('IntlDateFormatter in PHP 5.5 no longer depends on TZ environment.'); - } - - $tz = getenv('TZ'); - putenv('TZ=Europe/London'); - - $formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); - $formatter->setPattern('yyyy-MM-dd HH:mm:ss'); - - $this->assertEquals( - $this->getDateTime(0, 'Europe/London')->format('Y-m-d H:i:s'), - $formatter->format(0) - ); - - $this->assertEquals('Europe/London', getenv('TZ')); - - // Restores TZ. - putenv('TZ='.$tz); - } - public function testFormatWithTimezoneFromPhp() { - if (PHP_VERSION_ID < 50500) { - $this->markTestSkipped('Only in PHP 5.5 IntlDateFormatter depends on default timezone (`date_default_timezone_get()`).'); - } - $tz = date_default_timezone_get(); date_default_timezone_set('Europe/London'); @@ -842,11 +776,7 @@ public function testSetTimeZoneId($timeZoneId, $expectedTimeZoneId) { $formatter = $this->getDefaultDateFormatter(); - if (PHP_VERSION_ID >= 50500) { - $formatter->setTimeZone($timeZoneId); - } else { - $formatter->setTimeZoneId($timeZoneId); - } + $formatter->setTimeZone($timeZoneId); $this->assertEquals($expectedTimeZoneId, $formatter->getTimeZoneId()); } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index 2e7544b39e008..97247d47b540c 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -56,12 +56,7 @@ public function testFormatWithUnsupportedTimestampArgument() $formatter->format($localtime); } catch (\Exception $e) { $this->assertInstanceOf('Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException', $e); - - if (PHP_VERSION_ID >= 50304) { - $this->assertStringEndsWith('Only integer Unix timestamps and DateTime objects are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage()); - } else { - $this->assertStringEndsWith('Only integer Unix timestamps are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage()); - } + $this->assertStringEndsWith('Only integer Unix timestamps and DateTime objects are supported. Please install the "intl" extension for full localization capabilities.', $e->getMessage()); } } diff --git a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php index f5aceb4d72216..5bedcb98b2ea4 100644 --- a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php @@ -687,13 +687,7 @@ public function testParseTypeInt64With32BitIntegerInPhp32Bit() $parsedValue = $formatter->parse('-2,147,483,648', NumberFormatter::TYPE_INT64); - // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4 - // The negative PHP_INT_MAX was being converted to float - if ((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404) { - $this->assertInternalType('int', $parsedValue); - } else { - $this->assertInternalType('float', $parsedValue); - } + $this->assertInternalType('int', $parsedValue); $this->assertEquals(-2147483648, $parsedValue); } @@ -744,24 +738,12 @@ public function testParseTypeInt64With64BitIntegerInPhp64Bit() $parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64); $this->assertInternalType('integer', $parsedValue); - // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4 - // A 32 bit integer was being generated instead of a 64 bit integer - if (PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) { - $this->assertEquals(-2147483648, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range (PHP < 5.3.14 and PHP < 5.4.4).'); - } else { - $this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).'); - } + $this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).'); $parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64); $this->assertInternalType('integer', $parsedValue); - // Bug #59597 was fixed on PHP 5.3.14 and 5.4.4 - // A 32 bit integer was being generated instead of a 64 bit integer - if (PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) { - $this->assertEquals(2147483647, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range (PHP < 5.3.14 and PHP < 5.4.4).'); - } else { - $this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).'); - } + $this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).'); } /** diff --git a/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php b/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php index f62e8f534a3a9..2da267a6e4bfc 100644 --- a/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php @@ -34,10 +34,6 @@ class BCryptPasswordEncoder extends BasePasswordEncoder */ public function __construct($cost) { - if (!function_exists('password_hash')) { - throw new \RuntimeException('To use the BCrypt encoder, you need to upgrade to PHP 5.5 or install the "ircmaxell/password-compat" via Composer.'); - } - $cost = (int) $cost; if ($cost < 4 || $cost > 31) { throw new \InvalidArgumentException('Cost must be in the range of 4-31.'); diff --git a/src/Symfony/Component/Security/Core/Tests/Encoder/BCryptPasswordEncoderTest.php b/src/Symfony/Component/Security/Core/Tests/Encoder/BCryptPasswordEncoderTest.php index 2f7b845acd158..4d9ca6d48e614 100644 --- a/src/Symfony/Component/Security/Core/Tests/Encoder/BCryptPasswordEncoderTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Encoder/BCryptPasswordEncoderTest.php @@ -47,8 +47,6 @@ public function testCostInRange() public function testResultLength() { - $this->skipIfPhpVersionIsNotSupported(); - $encoder = new BCryptPasswordEncoder(self::VALID_COST); $result = $encoder->encodePassword(self::PASSWORD, null); $this->assertEquals(60, strlen($result)); @@ -56,21 +54,12 @@ public function testResultLength() public function testValidation() { - $this->skipIfPhpVersionIsNotSupported(); - $encoder = new BCryptPasswordEncoder(self::VALID_COST); $result = $encoder->encodePassword(self::PASSWORD, null); $this->assertTrue($encoder->isPasswordValid($result, self::PASSWORD, null)); $this->assertFalse($encoder->isPasswordValid($result, 'anotherPassword', null)); } - private function skipIfPhpVersionIsNotSupported() - { - if (PHP_VERSION_ID < 50307) { - $this->markTestSkipped('Requires PHP >= 5.3.7'); - } - } - /** * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException */ diff --git a/src/Symfony/Component/Security/Core/Util/SecureRandom.php b/src/Symfony/Component/Security/Core/Util/SecureRandom.php index aefc88854a648..f4167e4d2f41b 100644 --- a/src/Symfony/Component/Security/Core/Util/SecureRandom.php +++ b/src/Symfony/Component/Security/Core/Util/SecureRandom.php @@ -43,9 +43,7 @@ public function __construct($seedFile = null, LoggerInterface $logger = null) $this->logger = $logger; // determine whether to use OpenSSL - if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50304) { - $this->useOpenSsl = false; - } elseif (!function_exists('openssl_random_pseudo_bytes')) { + if (!function_exists('openssl_random_pseudo_bytes')) { if (null !== $this->logger) { $this->logger->notice('It is recommended that you enable the "openssl" extension for random number generation.'); } diff --git a/src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php b/src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php index 7ae27790e5000..f6f69f5e62724 100644 --- a/src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php +++ b/src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php @@ -51,10 +51,6 @@ public function testStoreTokenInClosedSession() public function testStoreTokenInClosedSessionWithExistingSessionId() { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('This test requires PHP 5.4 or later.'); - } - session_id('foobar'); $this->assertSame(PHP_SESSION_NONE, session_status()); diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php index 60145c65a05f1..4229bb637bcd2 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php @@ -108,11 +108,7 @@ public function removeToken($tokenId) private function startSession() { - if (PHP_VERSION_ID >= 50400) { - if (PHP_SESSION_NONE === session_status()) { - session_start(); - } - } elseif (!session_id()) { + if (PHP_SESSION_NONE === session_status()) { session_start(); } diff --git a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php index 277e04fac3c60..ed281fa4608a0 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php @@ -99,11 +99,7 @@ public function decode($data, $format, array $context = array()) $recursionDepth = $context['json_decode_recursion_depth']; $options = $context['json_decode_options']; - if (PHP_VERSION_ID >= 50400) { - $decodedData = json_decode($data, $associative, $recursionDepth, $options); - } else { - $decodedData = json_decode($data, $associative, $recursionDepth); - } + $decodedData = json_decode($data, $associative, $recursionDepth, $options); if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) { throw new UnexpectedValueException(JsonEncoder::getLastErrorMessage()); diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index db901b8cad261..77e13c94012d2 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -458,11 +458,7 @@ public function getGlobals() protected function initializeEscapers() { $that = $this; - if (PHP_VERSION_ID >= 50400) { - $flags = ENT_QUOTES | ENT_SUBSTITUTE; - } else { - $flags = ENT_QUOTES; - } + $flags = ENT_QUOTES | ENT_SUBSTITUTE; $this->escapers = array( 'html' => diff --git a/src/Symfony/Component/Translation/Tests/Dumper/JsonFileDumperTest.php b/src/Symfony/Component/Translation/Tests/Dumper/JsonFileDumperTest.php index 697cd939f607a..86594ef8bbdda 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/JsonFileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/JsonFileDumperTest.php @@ -18,10 +18,6 @@ class JsonFileDumperTest extends \PHPUnit_Framework_TestCase { public function testDump() { - if (PHP_VERSION_ID < 50400) { - $this->markTestIncomplete('PHP below 5.4 doesn\'t support JSON pretty printing'); - } - $catalogue = new MessageCatalogue('en'); $catalogue->add(array('foo' => 'bar')); diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php index 3e1e442f75225..4509e22ee191c 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php @@ -19,15 +19,6 @@ class LegacyValidator2Dot5ApiTest extends Abstract2Dot5ApiTest { - protected function setUp() - { - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - - parent::setUp(); - } - protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { $contextFactory = new LegacyExecutionContextFactory($metadataFactory, new DefaultTranslator()); diff --git a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php index 3f02a5af71c80..3f7bf1e5bb574 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/LegacyValidatorLegacyApiTest.php @@ -19,15 +19,6 @@ class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest { - protected function setUp() - { - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - - parent::setUp(); - } - protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) { $contextFactory = new LegacyExecutionContextFactory($metadataFactory, new DefaultTranslator()); diff --git a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php index ba184f7c784db..69689d639080f 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php @@ -112,13 +112,7 @@ public function testSetTranslationDomain() public function testDefaultApiVersion() { - if (PHP_VERSION_ID < 50309) { - // Old implementation on PHP < 5.3.9 - $this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator()); - } else { - // Legacy compatible implementation on PHP >= 5.3.9 - $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); - } + $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); } public function testSetApiVersion24() @@ -135,10 +129,6 @@ public function testSetApiVersion25() public function testSetApiVersion24And25() { - if (PHP_VERSION_ID < 50309) { - $this->markTestSkipped('Not supported prior to PHP 5.3.9'); - } - $this->assertSame($this->builder, $this->builder->setApiVersion(Validation::API_VERSION_2_5_BC)); $this->assertInstanceOf('Symfony\Component\Validator\Validator\LegacyValidator', $this->builder->getValidator()); } diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index f5cab110cd6ec..8151a444f7938 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -329,15 +329,6 @@ public function setApiVersion($apiVersion) )); } - if (PHP_VERSION_ID < 50309 && $apiVersion === Validation::API_VERSION_2_5_BC) { - throw new InvalidArgumentException(sprintf( - 'The Validator API that is compatible with both Symfony 2.4 '. - 'and Symfony 2.5 can only be used on PHP 5.3.9 and higher. '. - 'Your current PHP version is %s.', - PHP_VERSION - )); - } - $this->apiVersion = $apiVersion; return $this; @@ -389,9 +380,7 @@ public function getValidator() $apiVersion = $this->apiVersion; if (null === $apiVersion) { - $apiVersion = PHP_VERSION_ID < 50309 - ? Validation::API_VERSION_2_4 - : Validation::API_VERSION_2_5_BC; + $apiVersion = Validation::API_VERSION_2_5_BC; } if (Validation::API_VERSION_2_4 === $apiVersion) { diff --git a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php index 605977be80891..0827bba547ae8 100644 --- a/src/Symfony/Component/VarDumper/Cloner/VarCloner.php +++ b/src/Symfony/Component/VarDumper/Cloner/VarCloner.php @@ -266,7 +266,7 @@ private static function initHashMask() } else { // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below $obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush'); - foreach (debug_backtrace(PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { + foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) { if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && in_array($frame['function'], $obFuncs)) { $frame['line'] = 0; break; diff --git a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php index 49710aaa88eae..ed77ccb597ce1 100644 --- a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php @@ -38,7 +38,7 @@ public function testGet() ob_start(); $dumper->dump($data); $out = ob_get_clean(); - $closureLabel = PHP_VERSION_ID >= 50400 ? 'public method' : 'function'; + $closureLabel = 'public method'; $out = preg_replace('/[ \t]+$/m', '', $out); $intMax = PHP_INT_MAX; $res1 = (int) $var['res']; diff --git a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php index fc8a15f09fa61..87198d6d269d5 100644 --- a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php @@ -40,7 +40,7 @@ public function testGet() ob_start(); $dumper->dump($data); $out = ob_get_clean(); - $closureLabel = PHP_VERSION_ID >= 50400 ? 'public method' : 'function'; + $closureLabel = 'public method'; $out = preg_replace('/[ \t]+$/m', '', $out); $var['file'] = htmlspecialchars($var['file'], ENT_QUOTES, 'UTF-8'); $intMax = PHP_INT_MAX; diff --git a/src/Symfony/Component/Yaml/Exception/ParseException.php b/src/Symfony/Component/Yaml/Exception/ParseException.php index 0447dff137345..180e712e90f80 100644 --- a/src/Symfony/Component/Yaml/Exception/ParseException.php +++ b/src/Symfony/Component/Yaml/Exception/ParseException.php @@ -125,12 +125,7 @@ private function updateRepr() } if (null !== $this->parsedFile) { - if (PHP_VERSION_ID >= 50400) { - $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - } else { - $jsonOptions = 0; - } - $this->message .= sprintf(' in %s', json_encode($this->parsedFile, $jsonOptions)); + $this->message .= sprintf(' in %s', json_encode($this->parsedFile, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); } if ($this->parsedLine >= 0) { diff --git a/src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php b/src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php index e4eb9c98a15d1..7286d45a0939b 100644 --- a/src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php @@ -18,11 +18,7 @@ class ParseExceptionTest extends \PHPUnit_Framework_TestCase public function testGetMessage() { $exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml'); - if (PHP_VERSION_ID >= 50400) { - $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")'; - } else { - $message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")'; - } + $message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")'; $this->assertEquals($message, $exception->getMessage()); } @@ -30,11 +26,7 @@ public function testGetMessage() public function testGetMessageWithUnicodeInFilename() { $exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml'); - if (PHP_VERSION_ID >= 50400) { - $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")'; - } else { - $message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")'; - } + $message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")'; $this->assertEquals($message, $exception->getMessage()); }