| Total Complexity | 12 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 5 | class Helpers |
||
| 6 | { |
||
| 7 | |||
| 8 | 15 | public static function getHttpScheme(): string |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $file |
||
| 27 | * @param string $data |
||
| 28 | * @param string $mode |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | 2 | public static function writeFile(string $file, string $data, string $mode = 'w'): void |
|
| 32 | { |
||
| 33 | 2 | $f = fopen($file, $mode); |
|
| 34 | 2 | if ($f !== false) { |
|
| 35 | 2 | fwrite($f, $data); |
|
| 36 | 2 | fclose($f); |
|
| 37 | } |
||
| 38 | 2 | } |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $path |
||
| 42 | * @param int $permissions |
||
| 43 | * @return void |
||
| 44 | * @throws \Exception |
||
| 45 | */ |
||
| 46 | 13 | public static function createDirectory(string $path, int $permissions = 0777): void |
|
| 64 | ); |
||
| 65 | } |
||
| 69 |