It seems like array('steve' => functio... return $newDice; }) of type array<string,object<Clos...ve":"object<Closure>"}> is incompatible with the declared type array<integer,callable> of property $diceTypeCallbacks.
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...
21
'steve' => function ($_type, $diceCount) {
22
$newDice = [];
23
for ($i = 0; $i < $diceCount; $i++) {
24
$newDice[] = new SteveDice();
25
}
26
return $newDice;
27
}
28
];
29
}
30
31
32
public function handlesType(string $type) : bool
33
{
34
return array_key_exists(
35
$this->normaliseType($type),
36
$this->diceTypeCallbacks
37
);
38
}
39
40
/**
41
* @param string $type
42
* @param int $number
43
* @return Dice[]
44
*/
45
public function buildDice(string $type, int $number) : array
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..