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