Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.7085 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
56 | public function clear() |
||
57 | { |
||
58 | 4 | $path = realpath($this->getCacheDir()); |
|
59 | |||
60 | // false means the directory does not exist yet - it surely is empty then |
||
61 | 4 | if (!is_dir($path)) { |
|
62 | return; |
||
63 | 4 | } |
|
64 | 5 | ||
65 | $path = $this->getCacheDir(); |
||
66 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
||
67 | // @codeCoverageIgnoreStart |
||
68 | system('DEL /S '.$path); |
||
69 | } else { |
||
70 | // @codeCoverageIgnoreEnd |
||
71 | system('rm -r '.$path); |
||
72 | } |
||
73 | } |
||
74 | } |
||
75 |