1 | <?php |
||
5 | class Tax |
||
6 | { |
||
7 | protected $retention = false; |
||
8 | |||
9 | /** |
||
10 | * Create new instance of taxes. |
||
11 | * |
||
12 | * @param bool $retention |
||
13 | */ |
||
14 | public function __construct(bool $retention = false) |
||
18 | |||
19 | /** |
||
20 | * Get amount percentage for defined tax. |
||
21 | * |
||
22 | * @param string $type Type of the tax amount |
||
23 | * |
||
24 | * @return int $percentage Amount of the tax |
||
25 | */ |
||
26 | public function percentage($type = 'default'): float |
||
39 | |||
40 | /** |
||
41 | * Convert class to qualified Tax name. |
||
42 | * |
||
43 | * @return string Tax name in lower case |
||
44 | */ |
||
45 | protected function getTaxName(): string |
||
51 | |||
52 | /** |
||
53 | * Return retention instead of a given type if retention flag is activated. |
||
54 | * |
||
55 | * @param string $type Type of the tax amount |
||
56 | * |
||
57 | * @return string Type of the tax amount |
||
58 | */ |
||
59 | protected function parseTypePercentage($type = 'default') |
||
63 | |||
64 | public function __get($property) |
||
72 | |||
73 | public function __toString() |
||
77 | } |
||
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.