diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-10-12 22:40:03 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-10-14 09:50:06 +0200 |
commit | ace74ef866453d2ae87e3d15be181dc00343dbbf (patch) | |
tree | a20eab0f773ece47951143f4fe0835501cff5074 /lib/private/AppFramework/Utility/ControllerMethodReflector.php | |
parent | 9d6a58e6aef035dc99fd5dedddc8353b5d888491 (diff) | |
download | nextcloud-server-ace74ef866453d2ae87e3d15be181dc00343dbbf.tar.gz nextcloud-server-ace74ef866453d2ae87e3d15be181dc00343dbbf.zip |
Fix ReflectionType::__toString() is deprecated
As of PHP 7.1.0, ReflectionType::__toString() is deprecated, and ReflectionParameter::getType() may return an instance of ReflectionNamedType. To get the name of the parameter type, ReflectionNamedType() is available in this case.
https://www.php.net/manual/en/reflectionparameter.gettype.php
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private/AppFramework/Utility/ControllerMethodReflector.php')
-rw-r--r-- | lib/private/AppFramework/Utility/ControllerMethodReflector.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php index ef4a1959d66..7eee2ac8e52 100644 --- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php +++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php @@ -76,8 +76,8 @@ class ControllerMethodReflector implements IControllerMethodReflector { // over phpdoc annotations if (method_exists($param, 'getType')) { $type = $param->getType(); - if ($type !== null) { - $this->types[$param->getName()] = (string) $type; + if ($type instanceof \ReflectionNamedType) { + $this->types[$param->getName()] = $type->getName(); } } |