From d24a01c48f535ebf4f3b162bb9cc13ff3a8be316 Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 2 Jun 2023 21:13:59 +0200 Subject: [PATCH 1/8] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3c5dde7..b84b611 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ } ], "require": { - "php": ">=5.3.3", - "behat/behat": "~3.0" + "php": "^7.4 || ^8.0", + "behat/behat": "^3.6.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.36|^6.3|^7.5.15" + "phpunit/phpunit": "^8.5 || ^9.0" }, "autoload": { "psr-4": { "Caciobanu\\Behat\\DeprecationExtension\\": "src/" } From 597bbdafd503f9e64fb3c717678df9c0b4261c6f Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 2 Jun 2023 21:20:32 +0200 Subject: [PATCH 2/8] Update phpunit.xml.dist --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 470d52f..0374555 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ Date: Fri, 3 Jan 2025 20:32:57 +0200 Subject: [PATCH 3/8] Update deps --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b84b611..f1f0bc9 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,11 @@ } ], "require": { - "php": "^7.4 || ^8.0", - "behat/behat": "^3.6.1" + "php": "^8.1", + "behat/behat": "^3.16" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.0" + "phpunit/phpunit": "^9.6" }, "autoload": { "psr-4": { "Caciobanu\\Behat\\DeprecationExtension\\": "src/" } From 5fbcda25109d67d674249417bc0aab67ad3276f7 Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 3 Jan 2025 20:42:35 +0200 Subject: [PATCH 4/8] Update DeprecationExtensionTest.php --- Tests/ServiceContainer/DeprecationExtensionTest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Tests/ServiceContainer/DeprecationExtensionTest.php b/Tests/ServiceContainer/DeprecationExtensionTest.php index b686fe0..b980a00 100644 --- a/Tests/ServiceContainer/DeprecationExtensionTest.php +++ b/Tests/ServiceContainer/DeprecationExtensionTest.php @@ -5,6 +5,7 @@ use Behat\Testwork\ServiceContainer\Configuration\ConfigurationTree; use Caciobanu\Behat\DeprecationExtension\ServiceContainer\DeprecationExtension; use PHPUnit\Framework\TestCase; +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; @@ -45,11 +46,10 @@ public function testLoad() $this->assertEquals('%caciobanu.deprecation_extension.ignore%', (string) $definition->getArgument(1)); } - /** - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ public function testConfigureInvalidValue() { + $this->expectException(InvalidConfigurationException::class); + $configurationTree = new ConfigurationTree(); $tree = $configurationTree->getConfigTree(array(new DeprecationExtension())); @@ -63,11 +63,10 @@ public function testConfigureInvalidValue() )); } - /** - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ public function testConfigureInvalidIgnoreValue() { + $this->expectException(InvalidConfigurationException::class); + $configurationTree = new ConfigurationTree(); $tree = $configurationTree->getConfigTree(array(new DeprecationExtension())); From 0eab2cccd4d2da05212e0131cac181d25bae5e53 Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 3 Jan 2025 21:16:17 +0200 Subject: [PATCH 5/8] Fix error reporting --- src/Error/Handler/DeprecationErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Error/Handler/DeprecationErrorHandler.php b/src/Error/Handler/DeprecationErrorHandler.php index 853a69a..9e0de2f 100644 --- a/src/Error/Handler/DeprecationErrorHandler.php +++ b/src/Error/Handler/DeprecationErrorHandler.php @@ -79,7 +79,7 @@ public function register(Call $call, $level, $message) $trace = debug_backtrace(); $group = 'remaining'; - if (0 !== error_reporting()) { + if (E_USER_DEPRECATED !== (error_reporting() & E_USER_DEPRECATED)) { $group = 'unsilenced'; } From 1eb486a4715c1c7920434eb1137011837193f58d Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 3 Jan 2025 21:43:30 +0200 Subject: [PATCH 6/8] Update DeprecationErrorHandler.php --- src/Error/Handler/DeprecationErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Error/Handler/DeprecationErrorHandler.php b/src/Error/Handler/DeprecationErrorHandler.php index 9e0de2f..bc24b21 100644 --- a/src/Error/Handler/DeprecationErrorHandler.php +++ b/src/Error/Handler/DeprecationErrorHandler.php @@ -79,7 +79,7 @@ public function register(Call $call, $level, $message) $trace = debug_backtrace(); $group = 'remaining'; - if (E_USER_DEPRECATED !== (error_reporting() & E_USER_DEPRECATED)) { + if (E_USER_DEPRECATED === (error_reporting() & E_USER_DEPRECATED)) { $group = 'unsilenced'; } From dcb96d8fbc597b8e203279d707b91d05ada507ce Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 3 Jan 2025 22:02:38 +0200 Subject: [PATCH 7/8] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f1f0bc9..0f9ab26 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "php": "^8.1", - "behat/behat": "^3.16" + "behat/behat": "^3.6.1" }, "require-dev": { "phpunit/phpunit": "^9.6" From a2930715ba447f82c92e8d58240a4019d8218ed7 Mon Sep 17 00:00:00 2001 From: Catalin Ciobanu Date: Fri, 3 Jan 2025 22:03:11 +0200 Subject: [PATCH 8/8] Update phpunit.xml.dist --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0374555..a6a2778 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@