1 | <?php |
||
14 | class MatchResult extends DsManagerModel |
||
15 | { |
||
16 | /** |
||
17 | * @var |
||
18 | */ |
||
19 | private $goalHome; |
||
20 | /** |
||
21 | * @var |
||
22 | */ |
||
23 | private $goalAway; |
||
24 | /** |
||
25 | * @var Team |
||
26 | */ |
||
27 | private $homeTeam; |
||
28 | /** |
||
29 | * @var Team |
||
30 | */ |
||
31 | private $awayTeam; |
||
32 | |||
33 | /** |
||
34 | * MatchResult constructor. |
||
35 | * @param $goalHome |
||
36 | * @param $goalAway |
||
37 | * @param Team $home |
||
38 | * @param Team $away |
||
39 | */ |
||
40 | public function __construct($goalHome, $goalAway, Team $home, Team $away) |
||
47 | |||
48 | /** |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getWinnerLoser() |
||
52 | { |
||
53 | $isDraw = false; |
||
54 | $winner = $this->homeTeam; |
||
55 | $loser = $this->awayTeam; |
||
56 | if ($this->goalAway == $this->goalHome) { |
||
57 | $isDraw = true; |
||
58 | } else if ($this->goalHome < $this->goalAway) { |
||
59 | $winner = $this->awayTeam; |
||
60 | $loser = $this->homeTeam; |
||
61 | } |
||
62 | return [ |
||
63 | 'is_draw' => $isDraw, |
||
64 | 'winner_id' => $winner->id, |
||
65 | 'loser_id' => $loser->id |
||
66 | ]; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return array |
||
71 | */ |
||
72 | public function toArray() |
||
84 | /** |
||
85 | * @return array |
||
86 | */ |
||
87 | private function getScorers() |
||
101 | |||
102 | /** |
||
103 | * @param Team $team |
||
104 | * @return Player |
||
105 | */ |
||
106 | private function pickAScorer(Team $team) |
||
129 | |||
130 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.