From 03b7a5fd29f0bb6da811fd968786bff442512cbf Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Wed, 24 Jan 2024 16:10:48 -0400 Subject: [PATCH] Added typehints to Loader::class --- flight/core/Loader.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/flight/core/Loader.php b/flight/core/Loader.php index 0a64fb6..62e3de8 100644 --- a/flight/core/Loader.php +++ b/flight/core/Loader.php @@ -12,8 +12,6 @@ namespace flight\core; use Closure; use Exception; -use ReflectionClass; -use ReflectionException; /** * The Loader class is responsible for loading objects. It maintains @@ -50,7 +48,7 @@ class Loader * @param array $params Class initialization parameters * @param ?callable(T $instance): void $callback $callback Function to call after object instantiation */ - public function register(string $name, $class, array $params = [], ?callable $callback = null): void + public function register(string $name, string $class, array $params = [], ?callable $callback = null): void { unset($this->instances[$name]); @@ -75,7 +73,7 @@ class Loader * * @throws Exception * - * @return object Class instance + * @return ?object Class instance */ public function load(string $name, bool $shared = true): ?object { @@ -112,7 +110,7 @@ class Loader * * @param string $name Instance name * - * @return object Class instance + * @return ?object Class instance */ public function getInstance(string $name): ?object {