From 2c3f0d32be5147ec6b442899495ea1df18a7d6be Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 21 Aug 2019 09:54:17 +0200 Subject: fix deprecated usage of ReflectionType::__toString() --- phpunit-mock-objects-php74.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 phpunit-mock-objects-php74.patch (limited to 'phpunit-mock-objects-php74.patch') diff --git a/phpunit-mock-objects-php74.patch b/phpunit-mock-objects-php74.patch new file mode 100644 index 0000000..fe31d0f --- /dev/null +++ b/phpunit-mock-objects-php74.patch @@ -0,0 +1,30 @@ +Backported from PHPUnit 7 for PHPUnit 5 +https://github.com/sebastianbergmann/phpunit/commit/e11397fed729bfef7a9c76f7b193c27ad5710f6b + +diff -up ./src/Framework/MockObject/Generator.php.old ./src/Framework/MockObject/Generator.php +--- ./src/Framework/MockObject/Generator.php.old 2019-08-21 09:46:14.255390916 +0200 ++++ ./src/Framework/MockObject/Generator.php 2019-08-21 09:47:30.829930292 +0200 +@@ -1007,7 +1007,7 @@ class PHPUnit_Framework_MockObject_Gener + } + + if ($this->hasReturnType($method)) { +- $returnType = (string) $method->getReturnType(); ++ $returnType = $method->getReturnType()->getName(); + } else { + $returnType = ''; + } +@@ -1190,12 +1190,12 @@ class PHPUnit_Framework_MockObject_Gener + $typeDeclaration = ''; + + if (!$forCall) { +- if ($this->hasType($parameter) && (string) $parameter->getType() !== 'self') { ++ if ($this->hasType($parameter) && $parameter->getType()->getName() !== 'self') { + if (version_compare(PHP_VERSION, '7.1', '>=') && $parameter->allowsNull() && !$parameter->isVariadic()) { + $nullable = '?'; + } + +- $typeDeclaration = (string) $parameter->getType() . ' '; ++ $typeDeclaration = $parameter->getType()->getName() . ' '; + } elseif ($parameter->isArray()) { + $typeDeclaration = 'array '; + } elseif ($parameter->isCallable()) { -- cgit