| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function validate(): void |
||
| 12 | { |
||
| 13 | $logPath = $_ENV['LOG_PATH'] ?? ''; |
||
| 14 | if ($logPath === '') { |
||
| 15 | throw new EnvironmentValidationException( |
||
| 16 | 'LOG_PATH is not set in config' |
||
| 17 | ); |
||
| 18 | } |
||
| 19 | |||
| 20 | if (!is_writeable($logPath)) { |
||
| 21 | throw new EnvironmentValidationException( |
||
| 22 | sprintf( |
||
| 23 | 'LOG_PATH `%s` is not a valid writeable directory', |
||
| 24 | $logPath |
||
| 25 | ) |
||
| 30 |