From 1b56a0b6b9ff44769a1b6c1acdace2408776702a Mon Sep 17 00:00:00 2001 From: Daniel West Date: Thu, 11 Mar 2021 19:02:42 +0000 Subject: [PATCH 1/6] Fix calling deprecated getClass in php 8 --- src/HttpCall/HttpCallResultPoolResolver.php | 31 +++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/HttpCall/HttpCallResultPoolResolver.php b/src/HttpCall/HttpCallResultPoolResolver.php index 988d8533..1de936b0 100644 --- a/src/HttpCall/HttpCallResultPoolResolver.php +++ b/src/HttpCall/HttpCallResultPoolResolver.php @@ -23,14 +23,35 @@ public function resolveArguments(\ReflectionClass $classReflection, array $argum if ($constructor !== null) { $parameters = $constructor->getParameters(); foreach ($parameters as $parameter) { - if ( - null !== $parameter->getClass() - && isset($this->dependencies[$parameter->getClass()->name]) - ) { - $arguments[$parameter->name] = $this->dependencies[$parameter->getClass()->name]; + if ($dependency = $this->resolveDependency($parameter)) { + $arguments[$parameter->name] = $dependency; } } } return $arguments; } + + private function resolveDependency(\ReflectionParameter $parameter) + { + if (method_exists($parameter, 'getType')) { + if ( + ($type = $parameter->getType()) && + !$type->isBuiltin() && + ($name = $type->getName()) && + isset($this->dependencies[$name]) + ) { + return $this->dependencies[$name]; + } + return null; + } + + if ( + null !== $parameter->getClass() + && isset($this->dependencies[$parameter->getClass()->name]) + ) { + return $this->dependencies[$parameter->getClass()->name]; + } + + return null; + } } From 6ad17775277f69e8fcf078ea962c8a823da47650 Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Tue, 13 Sep 2022 17:06:03 +0100 Subject: [PATCH 2/6] Add symfony 6 support --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 00b70c0c..cfe6178e 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ "behat/behat": "^3.0.13", "friends-of-behat/mink-extension": "^2.3.1", "justinrainbow/json-schema": "^5.0", - "symfony/property-access": "^2.3|^3.0|^4.0|^5.0", - "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0", - "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0" + "symfony/property-access": "^2.3|^3.0|^4.0|^5.0|^6.0", + "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0|^6.0", + "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0|^6.0" }, "require-dev": { From bde70a4ca849e258430e0c111f468f8efab190c0 Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Tue, 13 Sep 2022 17:50:21 +0100 Subject: [PATCH 3/6] Fix json node exist error --- src/Context/JsonContext.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Context/JsonContext.php b/src/Context/JsonContext.php index d835fc91..eb6d6221 100644 --- a/src/Context/JsonContext.php +++ b/src/Context/JsonContext.php @@ -276,6 +276,9 @@ public function theJsonNodeShouldExist($name) } catch (\Exception $e) { throw new \Exception("The node '$name' does not exist."); } + if (!$node) { + throw new \Exception("The node '$name' does not exist."); + } return $node; } From 4bbed627e203a27ce5084784b8a92625de009900 Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Sat, 3 Feb 2024 11:14:48 +0000 Subject: [PATCH 4/6] Allow symfony 7 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cfe6178e..2c731adb 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ "behat/behat": "^3.0.13", "friends-of-behat/mink-extension": "^2.3.1", "justinrainbow/json-schema": "^5.0", - "symfony/property-access": "^2.3|^3.0|^4.0|^5.0|^6.0", - "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0|^6.0", - "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0|^6.0" + "symfony/property-access": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0", + "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0", + "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0|^6.0|^7.0" }, "require-dev": { From a0d8bd32791757624d0ff53242df5107d940d4b9 Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Mon, 15 Jun 2026 22:44:02 +0100 Subject: [PATCH 5/6] Remove abstract getSession declaration incompatible with PHP 8.5 / Symfony 8 The Html trait declared abstract getSession($name = null) which conflicts with the typed RawMinkContext::getSession(?string $name = null): Session signature in newer friends-of-behat/mink-extension. Remove the declaration (duck typing via the using class is sufficient) and the unused import. --- src/Html.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Html.php b/src/Html.php index f3f35b5a..e25bd1ae 100644 --- a/src/Html.php +++ b/src/Html.php @@ -2,12 +2,8 @@ namespace Behatch; -use Behat\MinkExtension\Context\RawMinkContext; - trait Html { - abstract protected function getSession($name = null); - protected function countElements($element, $index, $parent) { $page = $this->getSession()->getPage(); From 3b0cc147f14bb2d66e3da802d3141de965d32837 Mon Sep 17 00:00:00 2001 From: silverbackdan Date: Mon, 15 Jun 2026 23:42:42 +0100 Subject: [PATCH 6/6] Add support for symfony 8.0 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2c731adb..b8be727b 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,9 @@ "behat/behat": "^3.0.13", "friends-of-behat/mink-extension": "^2.3.1", "justinrainbow/json-schema": "^5.0", - "symfony/property-access": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0", - "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0", - "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0|^6.0|^7.0" + "symfony/property-access": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0|^8.0", + "symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0|^6.0|^7.0|^8.0", + "symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0|^6.0|^7.0|^8.0" }, "require-dev": {