1 | <?php |
||
11 | class ImagesTableSeeder extends Seeder |
||
12 | { |
||
13 | /** |
||
14 | * Lookup table to map images to projects. |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $projectLookup = [ |
||
19 | 'a' => 1, |
||
20 | 'b' => 2, |
||
21 | 'c' => 3, |
||
22 | 'd' => 4, |
||
23 | 'e' => 5, |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * User instance. |
||
28 | * |
||
29 | * @var User |
||
30 | */ |
||
31 | protected $user; |
||
32 | |||
33 | /** |
||
34 | * Run the database seeds. |
||
35 | */ |
||
36 | public function run() |
||
52 | |||
53 | /** |
||
54 | * Make images for project. |
||
55 | * |
||
56 | * @param \Illuminate\Filesystem\Filesystem $filesystem |
||
57 | */ |
||
58 | protected function makeProjectImages(Filesystem $filesystem) |
||
72 | |||
73 | /** |
||
74 | * Make images for project. |
||
75 | * |
||
76 | * @param \Illuminate\Filesystem\Filesystem $filesystem |
||
77 | */ |
||
78 | protected function makePageImages(Filesystem $filesystem) |
||
90 | |||
91 | /** |
||
92 | * Move image file to storage. |
||
93 | * |
||
94 | * @param \Symfony\Component\Finder\SplFileInfo $image File info. |
||
95 | * @param string $path Path to move to. |
||
96 | * @param \Illuminate\Filesystem\Filesystem $filesystem |
||
97 | */ |
||
98 | protected function moveImage($image, $path, Filesystem $filesystem) |
||
104 | |||
105 | /** |
||
106 | * Add image to a project. |
||
107 | * |
||
108 | * @param string $name Original filename. |
||
109 | * @param string $path Path to image. |
||
110 | */ |
||
111 | protected function addToProject($name, $path) |
||
119 | } |
||
120 |
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.