| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | 40 | public static function getTempBaseDir() |
|
| 45 | { |
||
| 46 | 40 | $dirs = self::$tempDirs; |
|
| 47 | // Fallback to sys temp dir |
||
| 48 | 40 | $dirs[] = sys_get_temp_dir(); |
|
| 49 | |||
| 50 | 40 | foreach ($dirs as $directory) { |
|
| 51 | 40 | if (file_exists($directory)) { |
|
| 52 | 40 | $baseDir = $directory . DIRECTORY_SEPARATOR . 'paraunit'; |
|
| 53 | 40 | self::mkdirIfNotExists($baseDir); |
|
| 54 | |||
| 55 | 40 | return $baseDir; |
|
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | throw new \RuntimeException('Unable to create a temporary directory'); |
||
| 60 | } |
||
| 61 | |||
| 78 |