1 | <?php |
||
7 | class File |
||
8 | { |
||
9 | /** |
||
10 | * Full path to file |
||
11 | * @var string |
||
12 | */ |
||
13 | private $path; |
||
14 | |||
15 | /** |
||
16 | * @var ISizeDriver |
||
17 | */ |
||
18 | private $sizeDriver; |
||
19 | |||
20 | /** |
||
21 | * File constructor. |
||
22 | * @param string $absoluteFilePath **absolute** path to file |
||
23 | * @param ISizeDriver $sizeDriver Driver used for determining file size |
||
24 | */ |
||
25 | public function __construct($absoluteFilePath, ISizeDriver $sizeDriver) |
||
30 | |||
31 | /** |
||
32 | * @return \Brick\Math\BigInteger |
||
33 | * @throws Driver\Exception |
||
34 | */ |
||
35 | public function getSize() |
||
39 | |||
40 | /** |
||
41 | * Absolute path to file |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getPath() |
||
48 | |||
49 | /** |
||
50 | * Returns PHP's file info (some values can be incorrect due to platform limitations) |
||
51 | * @return \SplFileInfo |
||
52 | */ |
||
53 | public function getFileInfo() |
||
57 | |||
58 | /** |
||
59 | * Returns if file exists and is readable |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function isReadableFile() |
||
75 | |||
76 | /** |
||
77 | * Moves file to new location / rename |
||
78 | * @param string $destination path |
||
79 | * @return bool |
||
80 | * @throws Exception |
||
81 | */ |
||
82 | function move($destination) |
||
103 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.