diff --git a/System/Di/Container.php b/System/Di/Container.php index 19b5616d..bbd405ec 100644 --- a/System/Di/Container.php +++ b/System/Di/Container.php @@ -128,6 +128,9 @@ class Container extends BaseObject private function resolve($class, $constrict, $config): object { [$reflect, $dependencies] = $this->resolveDependencies($class); + if (empty($reflect)) { + throw new \Exception('asdjakkjgsg'); + } foreach ($constrict as $index => $param) { $dependencies[$index] = $param; } diff --git a/System/Exception/NotFindClassException.php b/System/Exception/NotFindClassException.php index 8bb75b43..189353c7 100644 --- a/System/Exception/NotFindClassException.php +++ b/System/Exception/NotFindClassException.php @@ -11,6 +11,7 @@ namespace Snowflake\Exception; +use JetBrains\PhpStorm\Pure; use Throwable; /** @@ -26,7 +27,7 @@ class NotFindClassException extends \Exception * @param int $code * @param Throwable|null $previous */ - public function __construct(string $message = "", int $code = 0, Throwable $previous = null) + #[Pure] public function __construct(string $message = "", int $code = 0, Throwable $previous = null) { $message = "No class named `$message` was found, please check if the class name is correct"; parent::__construct($message, 404, $previous);