1 | <?php |
||
31 | class Component extends ComponentAbstract implements ComponentInterface, GeometryInterface |
||
32 | { |
||
33 | /** |
||
34 | * Initialize Component |
||
35 | * |
||
36 | * {@inheritdoc} |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | 37 | public function initializeComponent() : bool |
|
45 | |||
46 | /** |
||
47 | * Return DOM attribute contents |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function getDomAttributeString() : string |
|
56 | |||
57 | /** |
||
58 | * Set geometry primitive |
||
59 | * |
||
60 | * One of box, circle, cone, cylinder, plane, ring, sphere, torus, torusKnot. |
||
61 | * |
||
62 | * @param string $primitive |
||
63 | * @throws InvalidComponentArgumentException |
||
64 | * @return void |
||
65 | */ |
||
66 | 35 | public function primitive(string $primitive) |
|
76 | |||
77 | /** |
||
78 | * translate |
||
79 | * |
||
80 | * {@inheritdoc} |
||
81 | * |
||
82 | * @param float|int $x |
||
83 | * @param float|int $y |
||
84 | * @param float|int $z |
||
85 | * @return void |
||
86 | */ |
||
87 | 7 | public function translate(float $x = 0, float $y = 0, float $z = 0) |
|
91 | |||
92 | /** |
||
93 | * Set Buffer |
||
94 | * |
||
95 | * {@inheritdoc} |
||
96 | * |
||
97 | * @param bool $buffer |
||
98 | * @return void |
||
99 | */ |
||
100 | 1 | public function buffer(bool $buffer = true) |
|
104 | |||
105 | /** |
||
106 | * skipCache |
||
107 | * |
||
108 | * {@inheritdoc} |
||
109 | * |
||
110 | * @param bool $skipCache |
||
111 | * @return void |
||
112 | */ |
||
113 | 1 | public function skipCache(bool $skipCache = false) |
|
117 | } |
||
118 |
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.