1 | <?php |
||
13 | class MatchResult |
||
14 | { |
||
15 | /** |
||
16 | * @var |
||
17 | */ |
||
18 | private $goalHome; |
||
19 | /** |
||
20 | * @var |
||
21 | */ |
||
22 | private $goalAway; |
||
23 | /** |
||
24 | * @var Team |
||
25 | */ |
||
26 | private $homeTeam; |
||
27 | /** |
||
28 | * @var Team |
||
29 | */ |
||
30 | private $awayTeam; |
||
31 | |||
32 | /** |
||
33 | * MatchResult constructor. |
||
34 | * @param $goalHome |
||
35 | * @param $goalAway |
||
36 | * @param Team $home |
||
37 | * @param Team $away |
||
38 | */ |
||
39 | public function __construct($goalHome, $goalAway, Team $home, Team $away) |
||
46 | |||
47 | /** |
||
48 | * @return array |
||
49 | */ |
||
50 | public function getWinnerLoser() |
||
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | public function toArray() |
||
86 | |||
87 | /** |
||
88 | * @param array $team |
||
89 | * @return array |
||
90 | */ |
||
91 | private function cleanTeam(array $team) |
||
105 | |||
106 | /** |
||
107 | * @return array |
||
108 | */ |
||
109 | private function getScorers() |
||
123 | |||
124 | /** |
||
125 | * @param Team $team |
||
126 | * @return Player |
||
127 | */ |
||
128 | private function pickAScorer(Team $team) |
||
151 | |||
152 | } |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.