diff options
Diffstat (limited to 'phpunit-mock-objects-php74.patch')
-rw-r--r-- | phpunit-mock-objects-php74.patch | 30 |
1 files changed, 30 insertions, 0 deletions
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()) { |