Merge pull request #24037 from nextcloud/enh/reflectionparamter_getclass_deprecatred
ReflectionParamter::getClass is deprecated
This commit is contained in:
commit
c2588b0b10
|
@ -73,13 +73,13 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $class->newInstanceArgs(array_map(function (ReflectionParameter $parameter) {
|
return $class->newInstanceArgs(array_map(function (ReflectionParameter $parameter) {
|
||||||
$parameterClass = $parameter->getClass();
|
$parameterType = $parameter->getType();
|
||||||
|
|
||||||
|
$resolveName = $parameter->getName();
|
||||||
|
|
||||||
// try to find out if it is a class or a simple parameter
|
// try to find out if it is a class or a simple parameter
|
||||||
if ($parameterClass === null) {
|
if ($parameterType !== null && !$parameterType->isBuiltin()) {
|
||||||
$resolveName = $parameter->getName();
|
$resolveName = $parameterType->getName();
|
||||||
} else {
|
|
||||||
$resolveName = $parameterClass->name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -91,7 +91,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
||||||
return $parameter->getDefaultValue();
|
return $parameter->getDefaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($parameterClass !== null) {
|
if ($parameterType !== null && !$parameterType->isBuiltin()) {
|
||||||
$resolveName = $parameter->getName();
|
$resolveName = $parameter->getName();
|
||||||
return $this->query($resolveName);
|
return $this->query($resolveName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue