Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php interface AInterface { /** @param list<string> $items */ public function a(array $items): void; } class A implements AInterface { public function a(array $items): void { // ... } } class B { public function __construct( /** @var iterable<string> */ private readonly iterable $items, ) { } public function b(): void { $a = new A(); $array = []; foreach ($this->items as $item) { $array[] = $item; } $a->a($array); } }
Snippet created on June 5 2024 at 13:50 UTC
Settings
Get link