| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 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 | 2 | return; |
|
| 63 | } |
||
| 64 | |||
| 65 | 4 | $path = $this->getCacheDir(); |
|
| 66 | 4 | if (0 === stripos(PHP_OS, 'WIN')) { |
|
| 67 | // @codeCoverageIgnoreStart |
||
| 68 | system('DEL /S '.$path); |
||
| 69 | } else { |
||
| 70 | // @codeCoverageIgnoreEnd |
||
| 71 | 4 | system('rm -r '.$path); |
|
| 72 | } |
||
| 75 |