From 0f1cb7dbbd8dac16501e6d873fd3a214162e3241 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 2 Mar 2020 11:42:40 +0100 Subject: [PATCH 1/7] Prepare version 2.8.0 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ff27d4..e4e9bdc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 2.8.0 (2020-03-02) + + * Fixed deprecated/invalid method usage on logger interface + ### 2.7.0 (2019-04-03) * Use base64 for encoding nonces diff --git a/composer.json b/composer.json index dae08147..367a7991 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.7.x-dev" + "dev-master": "2.8.x-dev" } } } From 1ce1a4659a43262a7eeab9f0f5d75355b5ea3660 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Mon, 25 Nov 2019 20:30:27 +0100 Subject: [PATCH 2/7] Fix PHPUnit compatibility --- .travis.yml | 3 ++- Tests/EncrypterTest.php | 2 +- Tests/Listener/ClickjackingListenerTest.php | 2 +- Tests/Listener/ContentSecurityPolicyListenerTest.php | 2 +- Tests/Listener/ContentTypeListenerTest.php | 2 +- Tests/Listener/EncryptedCookieListenerTest.php | 2 +- Tests/Listener/ExternalRedirectListenerTest.php | 2 +- Tests/Listener/FlexibleSslListenerTest.php | 2 +- Tests/Listener/ForcedSslListenerTest.php | 2 +- Tests/Listener/ReferrerPolicyListenerTest.php | 2 +- Tests/Listener/SignedCookieListenerTest.php | 2 +- Tests/Listener/XssProtectionListenerTest.php | 2 +- Tests/Session/CookieSessionHandlerTest.php | 2 +- phpunit.xml.dist | 1 - 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90cf5a69..95c96985 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,7 @@ install: - if [[ $TRAVIS_PHP_VERSION == '5.5' ]]; then composer update --prefer-lowest ; fi script: - - export SYMFONY_DEPRECATIONS_HELPER=weak_vendors + - export SYMFONY_DEPRECATIONS_HELPER=max[self]=0 + - if [[ $TRAVIS_PHP_VERSION == '5.5' ]]; then export SYMFONY_DEPRECATIONS_HELPER=weak_vendors ; fi - export SYMFONY_PHPUNIT_DIR=`pwd`/.phpunit - ./vendor/bin/simple-phpunit diff --git a/Tests/EncrypterTest.php b/Tests/EncrypterTest.php index 83ac868e..d60a3ee1 100644 --- a/Tests/EncrypterTest.php +++ b/Tests/EncrypterTest.php @@ -15,7 +15,7 @@ class EncrypterTest extends \PHPUnit\Framework\TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/Tests/Listener/ClickjackingListenerTest.php b/Tests/Listener/ClickjackingListenerTest.php index 524422a6..1aff7b92 100644 --- a/Tests/Listener/ClickjackingListenerTest.php +++ b/Tests/Listener/ClickjackingListenerTest.php @@ -22,7 +22,7 @@ class ClickjackingListenerTest extends \PHPUnit\Framework\TestCase private $kernel; private $listener; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->listener = new ClickjackingListener(array( diff --git a/Tests/Listener/ContentSecurityPolicyListenerTest.php b/Tests/Listener/ContentSecurityPolicyListenerTest.php index dceb3cde..de9adb18 100644 --- a/Tests/Listener/ContentSecurityPolicyListenerTest.php +++ b/Tests/Listener/ContentSecurityPolicyListenerTest.php @@ -19,7 +19,7 @@ class ContentSecurityPolicyListenerTest extends \PHPUnit\Framework\TestCase private $nonceGenerator; private $shaComputer; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->nonceGenerator = $this->getMockBuilder('Nelmio\SecurityBundle\ContentSecurityPolicy\NonceGenerator') diff --git a/Tests/Listener/ContentTypeListenerTest.php b/Tests/Listener/ContentTypeListenerTest.php index c3e76e19..f5a29d3e 100644 --- a/Tests/Listener/ContentTypeListenerTest.php +++ b/Tests/Listener/ContentTypeListenerTest.php @@ -12,7 +12,7 @@ class ContentTypeListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/EncryptedCookieListenerTest.php b/Tests/Listener/EncryptedCookieListenerTest.php index 05dd3f24..704b68b9 100644 --- a/Tests/Listener/EncryptedCookieListenerTest.php +++ b/Tests/Listener/EncryptedCookieListenerTest.php @@ -25,7 +25,7 @@ class EncryptedCookieListenerTest extends \PHPUnit\Framework\TestCase private $encrypter; private $kernel; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Listener/ExternalRedirectListenerTest.php b/Tests/Listener/ExternalRedirectListenerTest.php index 03417af0..85321add 100644 --- a/Tests/Listener/ExternalRedirectListenerTest.php +++ b/Tests/Listener/ExternalRedirectListenerTest.php @@ -22,7 +22,7 @@ class ExternalRedirectListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/FlexibleSslListenerTest.php b/Tests/Listener/FlexibleSslListenerTest.php index 23edc8a5..2de2137e 100644 --- a/Tests/Listener/FlexibleSslListenerTest.php +++ b/Tests/Listener/FlexibleSslListenerTest.php @@ -26,7 +26,7 @@ class FlexibleSslListenerTest extends \PHPUnit\Framework\TestCase private $dispatcher; private $listener; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); diff --git a/Tests/Listener/ForcedSslListenerTest.php b/Tests/Listener/ForcedSslListenerTest.php index f3d6eddf..3c6636a5 100644 --- a/Tests/Listener/ForcedSslListenerTest.php +++ b/Tests/Listener/ForcedSslListenerTest.php @@ -22,7 +22,7 @@ class ForcedSslListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/ReferrerPolicyListenerTest.php b/Tests/Listener/ReferrerPolicyListenerTest.php index 24d25807..7a7ae28c 100644 --- a/Tests/Listener/ReferrerPolicyListenerTest.php +++ b/Tests/Listener/ReferrerPolicyListenerTest.php @@ -21,7 +21,7 @@ class ReferrerPolicyListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/SignedCookieListenerTest.php b/Tests/Listener/SignedCookieListenerTest.php index f24a6300..da525a66 100644 --- a/Tests/Listener/SignedCookieListenerTest.php +++ b/Tests/Listener/SignedCookieListenerTest.php @@ -26,7 +26,7 @@ class SignedCookieListenerTest extends \PHPUnit\Framework\TestCase private $signer; private $kernel; - protected function setUp() + protected function setUp(): void { $this->signer = new Signer('secret', 'sha1'); $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); diff --git a/Tests/Listener/XssProtectionListenerTest.php b/Tests/Listener/XssProtectionListenerTest.php index 4587624e..45cbeb8f 100644 --- a/Tests/Listener/XssProtectionListenerTest.php +++ b/Tests/Listener/XssProtectionListenerTest.php @@ -12,7 +12,7 @@ class XssProtectionListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp() + protected function setUp(): void { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Session/CookieSessionHandlerTest.php b/Tests/Session/CookieSessionHandlerTest.php index 5e64f37d..8ed6b26e 100644 --- a/Tests/Session/CookieSessionHandlerTest.php +++ b/Tests/Session/CookieSessionHandlerTest.php @@ -23,7 +23,7 @@ class CookieSessionHandlerTest extends \PHPUnit\Framework\TestCase private $handler; private $kernel; - public function setUp() + public function setUp(): void { $this->handler = new CookieSessionHandler('s'); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 04a1cd07..53179a67 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="Tests/bootstrap.php" > From e958ef55d02202535fe3dc5a818621cb1c78e229 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Mon, 25 Nov 2019 21:31:13 +0100 Subject: [PATCH 3/7] Use the new PHPUnit bridge --- .travis.yml | 1 - composer.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95c96985..d127ce5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,5 @@ install: script: - export SYMFONY_DEPRECATIONS_HELPER=max[self]=0 - - if [[ $TRAVIS_PHP_VERSION == '5.5' ]]; then export SYMFONY_DEPRECATIONS_HELPER=weak_vendors ; fi - export SYMFONY_PHPUNIT_DIR=`pwd`/.phpunit - ./vendor/bin/simple-phpunit diff --git a/composer.json b/composer.json index 367a7991..b878af26 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "psr/cache": "^1.0", "twig/twig": "^1.24", "symfony/yaml": "~2.3|~3.0|~4.0", - "symfony/phpunit-bridge": "^3.4.24|~4.0" + "symfony/phpunit-bridge": "~5.0" }, "suggest": { "ua-parser/uap-php": "To allow adapt CSP directives given the user-agent" From a953fe04735c141199e10b035e25e3123ce415cf Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Mon, 25 Nov 2019 21:59:32 +0100 Subject: [PATCH 4/7] Try the SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 option --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index d127ce5e..37d7c25a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,14 @@ matrix: include: - php: 5.4 dist: trusty + env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 - php: 5.5 dist: trusty + env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 + - php: 5.6 + env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 + - php: 7.0 + env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 before_install: - phpenv config-rm xdebug.ini || true From a8e0d475df8172a15749d87bbe7bbca895537491 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Tue, 26 Nov 2019 09:55:47 +0100 Subject: [PATCH 5/7] Properly use the SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT env var --- .travis.yml | 6 ------ Tests/EncrypterTest.php | 2 +- Tests/Listener/ClickjackingListenerTest.php | 2 +- Tests/Listener/ContentSecurityPolicyListenerTest.php | 2 +- Tests/Listener/ContentTypeListenerTest.php | 2 +- Tests/Listener/EncryptedCookieListenerTest.php | 2 +- Tests/Listener/ExternalRedirectListenerTest.php | 2 +- Tests/Listener/FlexibleSslListenerTest.php | 2 +- Tests/Listener/ForcedSslListenerTest.php | 2 +- Tests/Listener/ReferrerPolicyListenerTest.php | 2 +- Tests/Listener/SignedCookieListenerTest.php | 2 +- Tests/Listener/XssProtectionListenerTest.php | 2 +- Tests/Session/CookieSessionHandlerTest.php | 2 +- phpunit.xml.dist | 4 ++++ 14 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37d7c25a..d127ce5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,8 @@ matrix: include: - php: 5.4 dist: trusty - env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 - php: 5.5 dist: trusty - env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 - - php: 5.6 - env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 - - php: 7.0 - env: SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 before_install: - phpenv config-rm xdebug.ini || true diff --git a/Tests/EncrypterTest.php b/Tests/EncrypterTest.php index d60a3ee1..83ac868e 100644 --- a/Tests/EncrypterTest.php +++ b/Tests/EncrypterTest.php @@ -15,7 +15,7 @@ class EncrypterTest extends \PHPUnit\Framework\TestCase { - public function setUp(): void + public function setUp() { parent::setUp(); diff --git a/Tests/Listener/ClickjackingListenerTest.php b/Tests/Listener/ClickjackingListenerTest.php index 1aff7b92..524422a6 100644 --- a/Tests/Listener/ClickjackingListenerTest.php +++ b/Tests/Listener/ClickjackingListenerTest.php @@ -22,7 +22,7 @@ class ClickjackingListenerTest extends \PHPUnit\Framework\TestCase private $kernel; private $listener; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->listener = new ClickjackingListener(array( diff --git a/Tests/Listener/ContentSecurityPolicyListenerTest.php b/Tests/Listener/ContentSecurityPolicyListenerTest.php index de9adb18..dceb3cde 100644 --- a/Tests/Listener/ContentSecurityPolicyListenerTest.php +++ b/Tests/Listener/ContentSecurityPolicyListenerTest.php @@ -19,7 +19,7 @@ class ContentSecurityPolicyListenerTest extends \PHPUnit\Framework\TestCase private $nonceGenerator; private $shaComputer; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->nonceGenerator = $this->getMockBuilder('Nelmio\SecurityBundle\ContentSecurityPolicy\NonceGenerator') diff --git a/Tests/Listener/ContentTypeListenerTest.php b/Tests/Listener/ContentTypeListenerTest.php index f5a29d3e..c3e76e19 100644 --- a/Tests/Listener/ContentTypeListenerTest.php +++ b/Tests/Listener/ContentTypeListenerTest.php @@ -12,7 +12,7 @@ class ContentTypeListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/EncryptedCookieListenerTest.php b/Tests/Listener/EncryptedCookieListenerTest.php index 704b68b9..05dd3f24 100644 --- a/Tests/Listener/EncryptedCookieListenerTest.php +++ b/Tests/Listener/EncryptedCookieListenerTest.php @@ -25,7 +25,7 @@ class EncryptedCookieListenerTest extends \PHPUnit\Framework\TestCase private $encrypter; private $kernel; - protected function setUp(): void + protected function setUp() { parent::setUp(); diff --git a/Tests/Listener/ExternalRedirectListenerTest.php b/Tests/Listener/ExternalRedirectListenerTest.php index 85321add..03417af0 100644 --- a/Tests/Listener/ExternalRedirectListenerTest.php +++ b/Tests/Listener/ExternalRedirectListenerTest.php @@ -22,7 +22,7 @@ class ExternalRedirectListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/FlexibleSslListenerTest.php b/Tests/Listener/FlexibleSslListenerTest.php index 2de2137e..23edc8a5 100644 --- a/Tests/Listener/FlexibleSslListenerTest.php +++ b/Tests/Listener/FlexibleSslListenerTest.php @@ -26,7 +26,7 @@ class FlexibleSslListenerTest extends \PHPUnit\Framework\TestCase private $dispatcher; private $listener; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); $this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); diff --git a/Tests/Listener/ForcedSslListenerTest.php b/Tests/Listener/ForcedSslListenerTest.php index 3c6636a5..f3d6eddf 100644 --- a/Tests/Listener/ForcedSslListenerTest.php +++ b/Tests/Listener/ForcedSslListenerTest.php @@ -22,7 +22,7 @@ class ForcedSslListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/ReferrerPolicyListenerTest.php b/Tests/Listener/ReferrerPolicyListenerTest.php index 7a7ae28c..24d25807 100644 --- a/Tests/Listener/ReferrerPolicyListenerTest.php +++ b/Tests/Listener/ReferrerPolicyListenerTest.php @@ -21,7 +21,7 @@ class ReferrerPolicyListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Listener/SignedCookieListenerTest.php b/Tests/Listener/SignedCookieListenerTest.php index da525a66..f24a6300 100644 --- a/Tests/Listener/SignedCookieListenerTest.php +++ b/Tests/Listener/SignedCookieListenerTest.php @@ -26,7 +26,7 @@ class SignedCookieListenerTest extends \PHPUnit\Framework\TestCase private $signer; private $kernel; - protected function setUp(): void + protected function setUp() { $this->signer = new Signer('secret', 'sha1'); $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); diff --git a/Tests/Listener/XssProtectionListenerTest.php b/Tests/Listener/XssProtectionListenerTest.php index 45cbeb8f..4587624e 100644 --- a/Tests/Listener/XssProtectionListenerTest.php +++ b/Tests/Listener/XssProtectionListenerTest.php @@ -12,7 +12,7 @@ class XssProtectionListenerTest extends \PHPUnit\Framework\TestCase { private $kernel; - protected function setUp(): void + protected function setUp() { $this->kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock(); } diff --git a/Tests/Session/CookieSessionHandlerTest.php b/Tests/Session/CookieSessionHandlerTest.php index 8ed6b26e..5e64f37d 100644 --- a/Tests/Session/CookieSessionHandlerTest.php +++ b/Tests/Session/CookieSessionHandlerTest.php @@ -23,7 +23,7 @@ class CookieSessionHandlerTest extends \PHPUnit\Framework\TestCase private $handler; private $kernel; - public function setUp(): void + public function setUp() { $this->handler = new CookieSessionHandler('s'); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 53179a67..09a7533b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,6 +16,10 @@ + + + + ./ From e32054dbe6b1ae098ed6fd4d6540ec33f331fb4b Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Thu, 28 Nov 2019 20:58:44 +0100 Subject: [PATCH 6/7] Drop the tests for PHP 5.4 --- .travis.yml | 2 -- CHANGELOG.md | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d127ce5e..968c8f32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,6 @@ php: matrix: include: - - php: 5.4 - dist: trusty - php: 5.5 dist: trusty diff --git a/CHANGELOG.md b/CHANGELOG.md index e4e9bdc4..ba69e309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ ### 2.8.0 (2020-03-02) * Fixed deprecated/invalid method usage on logger interface - + * Drop tests for PHP 5.4 + ### 2.7.0 (2019-04-03) * Use base64 for encoding nonces From 12e78624c58017bc2bc9ad52601a9f43e74a6996 Mon Sep 17 00:00:00 2001 From: Damien ALEXANDRE Date: Tue, 3 Dec 2019 11:13:08 +0100 Subject: [PATCH 7/7] Force PHP > 5.4 in composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index b878af26..f639f6a4 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ } ], "require": { + "php": ">5.4", "paragonie/random_compat": "~1.0|~2.0|9.99.99", "symfony/framework-bundle": "~2.3|~3.0|~4.0", "symfony/security": "~2.3|~3.0|~4.0",