aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-10-14 11:08:15 +0200
committerGitHub <noreply@github.com>2019-10-14 11:08:15 +0200
commit61661036fc986f908fe975d52b8b0cdcf5eb2272 (patch)
treedc4180fa6131ff06b631172405652a74f7b7f2e6
parent9d6a58e6aef035dc99fd5dedddc8353b5d888491 (diff)
parent0ecc70c4970dfe6ef1d164c427379738680a5f29 (diff)
downloadnextcloud-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.php11
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;