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) |
||
23 | |||
24 | /** |
||
25 | * Used to pad the bubble to fit at least the size of the animal with empty spaces. |
||
26 | * @param $message |
||
27 | * @return string |
||
28 | */ |
||
29 | public function extendBubble($message) |
||
39 | |||
40 | /** |
||
41 | * Obtain the message as array wrapping the text |
||
42 | * @param $text |
||
43 | * @return array |
||
44 | */ |
||
45 | public function getMessageLines($text) |
||
54 | |||
55 | /** |
||
56 | * Find the longest line and get the line length |
||
57 | * @param array $lines |
||
58 | * @return int |
||
59 | */ |
||
60 | public function getMaxLineLength($lines) |
||
75 | |||
76 | /** |
||
77 | * Obtain the speech bubble. |
||
78 | * @param $text |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getSpeechBubble($text) |
||
103 | } |
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.