diff --git a/composer.json b/composer.json index 41d6e30..321c0ad 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,6 @@ "require-dev": { "ext-intl": "*", "brianium/paratest": "^6.3.0", - "cweagans/composer-patches": "^1.7.3", "infection/infection": "0.26.6", "latte/latte": "^2.5.0|^3.0.4", "nette/application": "^3.1.0", @@ -70,20 +69,9 @@ "config": { "sort-packages": true, "allow-plugins": { - "cweagans/composer-patches": true, "dealerdirect/phpcodesniffer-composer-installer": true, "infection/extension-installer": true, "phpstan/extension-installer": true } - }, - "extra": { - "patches": { - "phpunit/php-code-coverage": { - "Class not found error fix": "tests/Patches/coverage-invalid-file-error.patch" - }, - "infection/infection": { - "Class not found error fix": "tests/Patches/mutations-invalid-file-error.patch" - } - } } } diff --git a/tests/Patches/coverage-invalid-file-error.patch b/tests/Patches/coverage-invalid-file-error.patch deleted file mode 100644 index 2fea333..0000000 --- a/tests/Patches/coverage-invalid-file-error.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 085e85e23d86b49cae114fcbe322325462c058cc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Barto=C5=A1?= -Date: Fri, 23 Dec 2022 16:27:23 +0100 -Subject: [PATCH] Fix coverage failure in case of an invalid file - ---- - src/CodeCoverage.php | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/CodeCoverage.php b/src/CodeCoverage.php -index c35f27c8..9340f673 100644 ---- a/src/CodeCoverage.php -+++ b/src/CodeCoverage.php -@@ -550,7 +550,11 @@ private function processUncoveredFilesFromFilter(): void - - foreach ($uncoveredFiles as $uncoveredFile) { - if ($this->filter->isFile($uncoveredFile)) { -- include_once $uncoveredFile; -+ try { -+ include_once $uncoveredFile; -+ } catch (\Error $e) { -+ // Include may fail if file content is not valid (due to implementing/extending non-existent class, ...) -+ } - } - } - --- -2.34.1.windows.1 - diff --git a/tests/Patches/mutations-invalid-file-error.patch b/tests/Patches/mutations-invalid-file-error.patch deleted file mode 100644 index 0a54cde..0000000 --- a/tests/Patches/mutations-invalid-file-error.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1534b7afd75b80d3a6d0841c8f250db7242e56d4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Barto=C5=A1?= -Date: Fri, 23 Dec 2022 16:59:16 +0100 -Subject: [PATCH] Fix coverage failure in case of an invalid file - ---- - src/PhpParser/Visitor/ReflectionVisitor.php | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/PhpParser/Visitor/ReflectionVisitor.php b/src/PhpParser/Visitor/ReflectionVisitor.php -index 2115bf03..666a1c7f 100644 ---- a/src/PhpParser/Visitor/ReflectionVisitor.php -+++ b/src/PhpParser/Visitor/ReflectionVisitor.php -@@ -37,6 +37,7 @@ namespace Infection\PhpParser\Visitor; - - use function array_pop; - use function count; -+use Error; - use Infection\Reflection\AnonymousClassReflection; - use Infection\Reflection\ClassReflection; - use Infection\Reflection\CoreClassReflection; -@@ -184,7 +185,11 @@ final class ReflectionVisitor extends NodeVisitorAbstract - $fqn = FullyQualifiedClassNameManipulator::getFqcn($node); - - if ($fqn !== null) { -- return CoreClassReflection::fromClassName($fqn->toString()); -+ try { -+ return CoreClassReflection::fromClassName($fqn->toString()); -+ } catch (Error $e) { -+ return new NullReflection(); -+ } - } - - // TODO: check against interfaces --- -2.34.1.windows.1 -