summaryrefslogtreecommitdiffstats
path: root/php-phpunit-mock-objects5-php74.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-08-21 10:32:17 +0200
committerRemi Collet <remi@remirepo.net>2019-08-21 10:32:17 +0200
commitf29c7bd3b49aacff9159bd232c30d319dea7bc96 (patch)
treee9b8b5bae1e30476f87ab9e1c875447f36a9db67 /php-phpunit-mock-objects5-php74.patch
parent8e99176fd27426658c47256b891820b779508e16 (diff)
fix deprecated usage of ReflectionType::__toString()HEADmaster
Diffstat (limited to 'php-phpunit-mock-objects5-php74.patch')
-rw-r--r--php-phpunit-mock-objects5-php74.patch41
1 files changed, 41 insertions, 0 deletions
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()) {