1 | <?php |
||
4 | abstract class AbstractAnimal implements AnimalInterface |
||
5 | { |
||
6 | protected $character; |
||
7 | |||
8 | /** |
||
9 | * Make the animal speak. |
||
10 | * @param $text string A string you want the animal says |
||
11 | * @return string The animal speaks... |
||
12 | */ |
||
13 | public function say($text) |
||
19 | |||
20 | /** |
||
21 | * Obtain the message as array wrapping the text |
||
22 | * @param $text |
||
23 | * @return array |
||
24 | */ |
||
25 | public function getMessageLines($text) |
||
34 | |||
35 | /** |
||
36 | * Find the longest line and get the line length |
||
37 | * @param array $lines |
||
38 | * @return int |
||
39 | */ |
||
40 | public function getMaxLineLength(array $lines) |
||
52 | |||
53 | /** |
||
54 | * Obtain the speech bubble. |
||
55 | * @param $text |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getSpeechBubble($text) |
||
78 | } |
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.