瀏覽代碼

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

Fix ReflectionType::__toString() is deprecated
tags/v18.0.0beta1
Roeland Jago Douma 4 年之前
父節點
當前提交
61661036fc
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增7 行删除
  1. 4
    7
      lib/private/AppFramework/Utility/ControllerMethodReflector.php

+ 4
- 7
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;

Loading…
取消
儲存