diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-10-14 11:08:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-14 11:08:15 +0200 |
commit | 61661036fc986f908fe975d52b8b0cdcf5eb2272 (patch) | |
tree | dc4180fa6131ff06b631172405652a74f7b7f2e6 | |
parent | 9d6a58e6aef035dc99fd5dedddc8353b5d888491 (diff) | |
parent | 0ecc70c4970dfe6ef1d164c427379738680a5f29 (diff) | |
download | nextcloud-server-61661036fc986f908fe975d52b8b0cdcf5eb2272.tar.gz nextcloud-server-61661036fc986f908fe975d52b8b0cdcf5eb2272.zip |
Merge pull request #17522 from nextcloud/fix/noid/reflection-toString-deprecated
Fix ReflectionType::__toString() is deprecated
-rw-r--r-- | lib/private/AppFramework/Utility/ControllerMethodReflector.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php index ef4a1959d66..fd42606cf54 100644 --- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php +++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php @@ -72,13 +72,10 @@ class ControllerMethodReflector implements IControllerMethodReflector { } foreach ($reflection->getParameters() as $param) { - // extract type information from PHP 7 scalar types and prefer them - // over phpdoc annotations - if (method_exists($param, 'getType')) { - $type = $param->getType(); - if ($type !== null) { - $this->types[$param->getName()] = (string) $type; - } + // extract type information from PHP 7 scalar types and prefer them over phpdoc annotations + $type = $param->getType(); + if ($type instanceof \ReflectionNamedType) { + $this->types[$param->getName()] = $type->getName(); } $default = null; |