diff --git a/system/arrayClass/CaseInsensitiveArray.php b/system/arrayClass/CaseInsensitiveArray.php index 366b03d..b2fb012 100644 --- a/system/arrayClass/CaseInsensitiveArray.php +++ b/system/arrayClass/CaseInsensitiveArray.php @@ -7,7 +7,7 @@ namespace Phacil\Framework\ArrayClass; -if (version_compare(phpversion(), "7.1.0", "<")) { +if (version_compare(phpversion(), "8.0.0", "<")) { class supCaseComp extends \Phacil\Framework\ArrayClass\Aux\LegacyAux { diff --git a/system/engine/registry.php b/system/engine/registry.php index 7291db3..4a222bd 100644 --- a/system/engine/registry.php +++ b/system/engine/registry.php @@ -195,14 +195,27 @@ final class Registry { foreach ($params as $param) { //$param is an instance of ReflectionParameter try { - if ($param->getType()) { - $injectionClass = $param->getType()->getName(); - if (class_exists($injectionClass)) { - $argsToInject[$param->getPosition()] = $this->injectionClass($injectionClass); - continue; + if (version_compare(phpversion(), "7.2.0", "<")) { + if ($param->getClass()) { + $injectionClass = $param->getClass()->name; + if (class_exists($injectionClass)) { + $argsToInject[$param->getPosition()] = $this->injectionClass($injectionClass); + continue; + } + if (!$param->isOptional()) { + throw new \Phacil\Framework\Exception\ReflectionException("Error Processing Request: " . $injectionClass . "not exist"); + } } - if (!$param->isOptional()) { - throw new \Phacil\Framework\Exception\ReflectionException("Error Processing Request: " . $injectionClass . "not exist"); + } else { + if ($param->getType()) { + $injectionClass = $param->getType()->getName(); + if (class_exists($injectionClass)) { + $argsToInject[$param->getPosition()] = $this->injectionClass($injectionClass); + continue; + } + if (!$param->isOptional()) { + throw new \Phacil\Framework\Exception\ReflectionException("Error Processing Request: " . $injectionClass . "not exist"); + } } } } catch (\Exception $th) {