| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public static function pathFor(string $storeType, string $identifier): string |
||
| 22 | { |
||
| 23 | $root = EnvHelper::getRootPath(); |
||
| 24 | $dir = $root . DIRECTORY_SEPARATOR . 'CacheerPHP' . DIRECTORY_SEPARATOR . 'Flush'; |
||
| 25 | if (!is_dir($dir)) { |
||
| 26 | @mkdir($dir, 0755, true); |
||
|
|
|||
| 27 | } |
||
| 28 | $safeId = preg_replace('/[^a-zA-Z0-9_-]+/', '_', $identifier); |
||
| 29 | return $dir . DIRECTORY_SEPARATOR . $storeType . '_' . $safeId . '.time'; |
||
| 30 | } |
||
| 33 |
If you suppress an error, we recommend checking for the error condition explicitly: