From b51299104b25b82ee6dcca70c83e70d9f0e6ab22 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Thu, 23 May 2024 07:06:40 +0900 Subject: [PATCH] Soothe psalm Added an assertion in the Compiler class to ensure that each dependency is an instance of AcceptInterface. This enhances code robustness by ensuring the types of the dependencies being handled. --- src/Compiler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compiler.php b/src/Compiler.php index f8dd61cc..53f81dcb 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -28,6 +28,7 @@ public function compile(AbstractModule $module, string $scriptDir): Scripts // Compile dependencies $compileVisitor = new CompileVisitor($container); $container->map(static function (DependencyInterface $dependency, string $key) use ($scripts, $compileVisitor): DependencyInterface { + assert($dependency instanceof AcceptInterface); $script = $dependency->accept($compileVisitor); assert(is_string($script)); $scripts->add($key, $script);