1 | <?php |
||
7 | class Fixtures |
||
8 | { |
||
9 | protected $testDir; |
||
10 | protected $tmpDirs = []; |
||
11 | protected $clonedRepos = []; |
||
12 | |||
13 | /** |
||
14 | * Fixtures constructor |
||
15 | */ |
||
16 | public function __construct() |
||
20 | |||
21 | /** |
||
22 | * Clean up any temporary directories that may have been created |
||
23 | */ |
||
24 | public function cleanup() |
||
37 | |||
38 | /** |
||
39 | * Create a new temporary directory. |
||
40 | * |
||
41 | * @param string|bool $basedir Where to store the temporary directory |
||
42 | * @return type |
||
43 | */ |
||
44 | public function mktmpdir($basedir = false) |
||
52 | |||
53 | public function createAndCdToSandbox() |
||
63 | |||
64 | public function dataFile($filename) |
||
68 | |||
69 | protected function fixturesDir() |
||
73 | |||
74 | protected function sandboxDir() |
||
78 | |||
79 | protected function testDir() |
||
86 | } |
||
87 |
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.