From f29c7bd3b49aacff9159bd232c30d319dea7bc96 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 21 Aug 2019 10:32:17 +0200 Subject: fix deprecated usage of ReflectionType::__toString() --- php-phpunit-mock-objects5-php74.patch | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 php-phpunit-mock-objects5-php74.patch (limited to 'php-phpunit-mock-objects5-php74.patch') diff --git a/php-phpunit-mock-objects5-php74.patch b/php-phpunit-mock-objects5-php74.patch new file mode 100644 index 0000000..55f49d4 --- /dev/null +++ b/php-phpunit-mock-objects5-php74.patch @@ -0,0 +1,41 @@ +Backported from PHPUnit 7 for PHPUnit 6 +https://github.com/sebastianbergmann/phpunit/commit/e11397fed729bfef7a9c76f7b193c27ad5710f6b + +diff -up ./src/Generator.php.php74 ./src/Generator.php +--- ./src/Generator.php.php74 2019-08-21 10:24:51.680612378 +0200 ++++ ./src/Generator.php 2019-08-21 10:26:01.331099137 +0200 +@@ -919,7 +919,11 @@ class Generator + } + + if ($method->hasReturnType()) { +- $returnType = (string) $method->getReturnType(); ++ if (PHP_VERSION_ID >= 70100) { ++ $returnType = $method->getReturnType()->getName(); ++ } else { ++ $returnType = (string) $method->getReturnType(); ++ } + } else { + $returnType = ''; + } +@@ -1085,12 +1089,19 @@ class Generator + $typeDeclaration = ''; + + if (!$forCall) { ++ if ($parameter->hasType()) { ++ if (PHP_VERSION_ID >= 70100) { ++ $typename = $parameter->getType()->getName(); ++ } else { ++ $typename = (string) $parameter->getType(); ++ } ++ } + if (PHP_VERSION_ID >= 70100 && $parameter->hasType() && $parameter->allowsNull()) { + $nullable = '?'; + } + +- if ($parameter->hasType() && (string) $parameter->getType() !== 'self') { +- $typeDeclaration = (string) $parameter->getType() . ' '; ++ if ($parameter->hasType() && $typename !== 'self') { ++ $typeDeclaration = $typename . ' '; + } elseif ($parameter->isArray()) { + $typeDeclaration = 'array '; + } elseif ($parameter->isCallable()) { -- cgit