From b707d3359ed1d3bbb84d545e5efc5e677b0cc9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 19:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Di/Container.php | 3 +++ System/Exception/NotFindClassException.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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);