diff --git a/src/Core/src/Internal/Config/StateBinder.php b/src/Core/src/Internal/Config/StateBinder.php index d02397b03..9b0a2ba97 100644 --- a/src/Core/src/Internal/Config/StateBinder.php +++ b/src/Core/src/Internal/Config/StateBinder.php @@ -112,16 +112,16 @@ public function removeInjector(string $class): void public function hasInjector(string $class): bool { + if (\array_key_exists($class, $this->state->injectors)) { + return true; + } + try { $reflection = new \ReflectionClass($class); } catch (\ReflectionException $e) { throw new ContainerException($e->getMessage(), $e->getCode(), $e); } - if (\array_key_exists($class, $this->state->injectors)) { - return true; - } - if ( $reflection->implementsInterface(InjectableInterface::class) && $reflection->hasConstant('INJECTOR')