1 | <?php |
||
6 | class download { |
||
7 | |||
8 | /** |
||
9 | * File directory |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $directory; |
||
13 | |||
14 | /** |
||
15 | * File name |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $filename; |
||
19 | |||
20 | /** |
||
21 | * File pointer |
||
22 | * @var resource |
||
23 | */ |
||
24 | protected $file; |
||
25 | |||
26 | /** |
||
27 | * File full path |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $full_path; |
||
31 | |||
32 | /** |
||
33 | * @param string $phpbb_root_path phpBB root path |
||
34 | */ |
||
35 | public function __construct($phpbb_root_path) { |
||
38 | |||
39 | |||
40 | /** |
||
41 | * Set the filename |
||
42 | * @param string $filename File name |
||
43 | * @throws InvalidArgumentException when the file not exist or is not readable |
||
44 | */ |
||
45 | public function setFile($filename) { |
||
56 | |||
57 | /** |
||
58 | * Get file mime type |
||
59 | * @return string |
||
60 | */ |
||
61 | private function getMimeType() { |
||
68 | |||
69 | /** |
||
70 | * Get file size |
||
71 | * @return int |
||
72 | */ |
||
73 | private function getFileSize() { |
||
77 | |||
78 | /** |
||
79 | * Sends the download to browser |
||
80 | * @param bool|true $forceDownload |
||
81 | */ |
||
82 | public function sendDownload($forceDownload = true) { |
||
112 | |||
113 | } |
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.