summaryrefslogtreecommitdiffstats
path: root/25.patch
blob: bd6e25eeee01ffe3053a01dd06d2d5f5b16974c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From fd15500d437d41ab0351ca0c706bfbf049599241 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 22 Aug 2019 14:04:10 +0200
Subject: [PATCH] fix test for PHP 7.4

---
 tests/reflection.phpt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/reflection.phpt b/tests/reflection.phpt
index ac0e9c0..a9c3613 100644
--- a/tests/reflection.phpt
+++ b/tests/reflection.phpt
@@ -32,13 +32,13 @@ function print_method_summary(ReflectionClass $class, string $method)
     printf("%s\n", $method->getName());
     printf("Number of parameters: %d\n", $method->getNumberOfParameters());
     printf("Number of required parameters: %d\n", $method->getNumberOfRequiredParameters());
-    printf("Return type: %s\n", $method->hasReturnType() ? $method->getReturnType() : "void");
+    printf("Return type: %s\n", $method->hasReturnType() ? (PHP_VERSION_ID >= 70100 ? $method->getReturnType()->getName() : (string) $method->getReturnType()) : "void");
     printf("Allows return null? %s\n", $method->hasReturnType() ? ($method->getReturnType()->allowsNull() ? "yes" : "no") : "no");
     printf("Returns reference? %s\n", $method->returnsReference() ? "yes" : "no");
     printf("Parameters:\n");
     foreach ($method->getParameters() as $parameter) {
         printf("Name: %s\n", $parameter->getName());
-        printf("Type: %s\n", ((string) $parameter->getType()) ?: "mixed");
+        printf("Type: %s\n", ($parameter->hasType() ? (PHP_VERSION_ID >= 70100 ? $parameter->getType()->getName() : (string) $parameter->getType()) : "mixed"));
         printf("Reference? %s\n", $parameter->isPassedByReference() ? "yes" : "no");
         printf("Allows null? %s\n", $parameter->allowsNull() ? "yes" : "no");
         printf("Optional? %s\n", $parameter->isOptional() ? "yes" : "no");