Skip to content

Commit

Permalink
Soothe psalm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koriym committed May 22, 2024
1 parent 0567a41 commit b512991
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b512991

Please sign in to comment.