| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 17 | public static function header(string $string, bool $replace = true, int $http_response_code = 0) |
|
| 19 | { |
||
| 20 | 17 | if (!defined('OPENPSA2_UNITTEST_RUN')) { |
|
| 21 | header($string, $replace, $http_response_code); |
||
| 22 | } else { |
||
| 23 | 17 | self::$_headers[] = [ |
|
| 24 | 17 | 'value' => $string, |
|
| 25 | 17 | 'replace' => $replace, |
|
| 26 | 17 | 'http_response_code' => $http_response_code |
|
| 27 | 17 | ]; |
|
| 45 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.