We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f48890b commit 520bb1dCopy full SHA for 520bb1d
lib/StandardReflector.php
@@ -25,9 +25,17 @@ public function getCtorParams($class)
25
26
public function getParamTypeHint(\ReflectionFunctionAbstract $function, \ReflectionParameter $param)
27
{
28
- return ($reflectionClass = $param->getClass())
29
- ? $reflectionClass->getName()
30
- : null;
+ // php 8 deprecates getClass method
+ if (PHP_VERSION_ID >= 80000) {
+ $reflectionClass = $param->getType() ? (string) $param->getType() : null;
31
+ } else {
32
+ /** @var ?\ReflectionClass $reflectionClass */
33
+ $reflectionClass = $param->getClass();
34
+ if ($reflectionClass) {
35
+ $reflectionClass = $reflectionClass->getName();
36
+ }
37
38
+ return $reflectionClass ?? null;
39
}
40
41
public function getFunction($functionName)
0 commit comments