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