From 0ef1aac4f4855136d72064a586264bd83a3bbd3f Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 29 Nov 2024 09:20:36 +0900 Subject: [PATCH] Add ScriptDir annotation to Compiler class Introduced the ScriptDir annotation to enhance the type safety of the $scriptDir parameter in the Compiler class. This change ensures consistency and correctness throughout the codebase by leveraging psalm-import-type for better type management. --- src/Compiler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Compiler.php b/src/Compiler.php index d065504..2761e13 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -7,6 +7,7 @@ use Ray\Compiler\Exception\CompileLockFailed; use Ray\Di\AbstractModule; use Ray\Di\AcceptInterface; +use Ray\Di\Annotation\ScriptDir; use Ray\Di\ContainerFactory; use Ray\Di\DependencyInterface; @@ -19,10 +20,14 @@ use const LOCK_EX; use const LOCK_UN; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class Compiler { /** * Compiles a given module into Scripts + * @param ScriptDir $scriptDir * * @SuppressWarnings(PHPMD.UnusedFormalParameter) // @phpstan-ignore-line */