It seems like $members of type array<integer,MySociety\...Class\Groups\MiniGroup> is incompatible with the declared type Rutek\Dataclass\T[] of property $items.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
Loading history...
15
}
16
17
public function findByName(string $name): ?MiniGroup {
18
foreach ($this->items as $member) {
19
if ($member->name === $name) {
20
return $member;
21
}
22
}
23
return null;
24
}
25
26
public function findBySlug(string $slug): ?MiniGroup {
The expression return $result returns the type MySociety\TheyWorkForYou\DataClass\BaseInterface which includes types incompatible with the type-hinted return MySociety\TheyWorkForYou...ss\Groups\MiniGroupList.
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..