Skip to content
Snippets Groups Projects
Unverified Commit c2588b0b authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #24037 from nextcloud/enh/reflectionparamter_getclass_deprecatred

ReflectionParamter::getClass is deprecated
parents fec679dd 51a02c80
No related branches found
No related tags found
No related merge requests found
...@@ -73,13 +73,13 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { ...@@ -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 { ...@@ -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);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment