It seems like $collections of type array<integer,App\GameBe...s\Score\ScoreInterface> is incompatible with the declared type App\GameBetting\Business...ts\Score\ScoreInterface of property $collections.
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...
23
}
24
25
/**
26
* @param ExtraResult $extraResult
27
* @return int
28
*/
29
public function get(ExtraResult $extraResult): int
$this->collections of type App\GameBetting\Business...ts\Score\ScoreInterface is incompatible with the type array expected by parameter $array of usort().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
33
usort(/** @scrutinizer ignore-type */ $this->collections, function ($a, $b) {
It seems like array_reverse($this->collections) of type array is incompatible with the declared type App\GameBetting\Business...ts\Score\ScoreInterface of property $collections.
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...
37
38
$score = 0;
39
40
foreach ($this->collections as $collection) {
41
if ($collection->check($extraResult) === true) {
42
$score = $collection->getScore();
43
break;
44
}
45
}
46
47
return $score;
48
}
49
50
51
private function checkCollection()
52
{
53
foreach ($this->collections as $collection) {
54
if (!$collection instanceof ScoreInterface) {
55
throw new \RuntimeException('Collection: ' . get_class($collection) . 'is not instanceof ' . ScoreInterface::class);
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..