1 | <?php namespace Anomaly\Streams\Platform\Addon\Console\Command; |
||
13 | class WriteAddonFeatureTest |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * The addon path. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private $path; |
||
22 | |||
23 | /** |
||
24 | * The addon type. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $type; |
||
29 | |||
30 | /** |
||
31 | * The addon slug. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $slug; |
||
36 | |||
37 | /** |
||
38 | * The vendor slug. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | private $vendor; |
||
43 | |||
44 | /** |
||
45 | * Create a new WriteAddonFeatureTest instance. |
||
46 | * |
||
47 | * @param $path |
||
48 | * @param $type |
||
49 | * @param $slug |
||
50 | * @param $vendor |
||
51 | */ |
||
52 | public function __construct($path, $type, $slug, $vendor) |
||
59 | |||
60 | /** |
||
61 | * Handle the command. |
||
62 | * |
||
63 | * @param Parser $parser |
||
64 | * @param Filesystem $filesystem |
||
65 | */ |
||
66 | public function handle(Parser $parser, Filesystem $filesystem) |
||
88 | } |
||
89 |
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.