summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Utility
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-11-10 21:05:32 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2020-11-11 20:42:14 +0100
commit51a02c800937d77f214082d744341adb0d00ca0a (patch)
treeed257a1b27ef1a4ab295e7824e02701f576295e3 /lib/private/AppFramework/Utility
parentfec679dd8d38862b8039034b28d6deaf0d7ab51b (diff)
downloadnextcloud-server-51a02c800937d77f214082d744341adb0d00ca0a.tar.gz
nextcloud-server-51a02c800937d77f214082d744341adb0d00ca0a.zip
ReflectionParamter::getClass is deprecated
In php8 this starts throwing warnings. And since we use it quite often we flood the log. This moves it to getType which does the same. Only non deprecated now. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/Utility')
-rw-r--r--lib/private/AppFramework/Utility/SimpleContainer.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php
index 3bb275a4d3c..f73e09e645e 100644
--- a/lib/private/AppFramework/Utility/SimpleContainer.php
+++ b/lib/private/AppFramework/Utility/SimpleContainer.php
@@ -73,13 +73,13 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
}
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
- if ($parameterClass === null) {
- $resolveName = $parameter->getName();
- } else {
- $resolveName = $parameterClass->name;
+ if ($parameterType !== null && !$parameterType->isBuiltin()) {
+ $resolveName = $parameterType->getName();
}
try {
@@ -91,7 +91,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
return $parameter->getDefaultValue();
}
- if ($parameterClass !== null) {
+ if ($parameterType !== null && !$parameterType->isBuiltin()) {
$resolveName = $parameter->getName();
return $this->query($resolveName);
}