Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 11 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
36 | public function accept(): bool |
||
37 | { |
||
38 | $filename = $this->getRealPath(); |
||
39 | // Broken symlinks will have an empty RealPath (because they don't exist) |
||
40 | if (!empty($filename)) { |
||
41 | return ($this->getMTime() <= $this->fromTimestamp); |
||
42 | } |
||
43 | |||
44 | // Empty filename, so most probably a broken symlink |
||
45 | return false; |
||
46 | } |
||
47 | } |
||
48 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.