danbettles /
defence
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace DanBettles\Defence; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Wraps a selection of PHP functions so that we can work with mock objects in tests and test otherwise untestable code. |
||
| 9 | */ |
||
| 10 | class PhpFunctionsWrapper |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * See https://www.php.net/manual/en/function.exit.php |
||
| 14 | * |
||
| 15 | * @param string|int $status |
||
| 16 | * @return never |
||
| 17 | */ |
||
| 18 | public function exit($status = 0) |
||
| 19 | { |
||
| 20 | //@codingStandardsIgnoreStart |
||
| 21 | /** @scrutinizer ignore-call */ exit($status); |
||
|
0 ignored issues
–
show
|
|||
| 22 | //@codingStandardsIgnoreEnd |
||
| 23 | } |
||
| 24 | } |
||
| 25 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.