The expression return $this->newCopy($crates) returns the type Stratadox\Collection\Collection which includes types incompatible with the type-hinted return Stratadox\PuzzleSolver\Puzzle\SlidingCrates\Crates.
Loading history...
35
}
36
37
public function withId(string $id): Crate
38
{
39
foreach ($this as $crate) {
40
if ($crate->id() === $id) {
41
return $crate;
42
}
43
}
44
throw new RuntimeException("No crate with id $id");