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