Merge pull request #17522 from nextcloud/fix/noid/reflection-toString-deprecated

Fix ReflectionType::__toString() is deprecated
This commit is contained in:
Roeland Jago Douma 2019-10-14 11:08:15 +02:00 committed by GitHub
commit 61661036fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -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;