| Total Complexity | 4 |
| Total Lines | 88 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | trait HelperTrait |
||
|
1 ignored issue
–
show
|
|||
| 5 | { |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Halts the execution of the program. It's like calling exit() but using builtin Slim Exceptions |
||
| 9 | * |
||
| 10 | * @param string $msg The message to show to the user |
||
| 11 | * |
||
| 12 | * @throws \Slim\Exception\SlimException (description) |
||
| 13 | */ |
||
|
1 ignored issue
–
show
|
|||
| 14 | public function halt($msg = 'An error has happened') |
||
| 15 | { |
||
| 16 | $body = $this->container->responseobj->getBody(); |
||
| 17 | $body->write($msg); |
||
| 18 | throw new \Slim\Exception\SlimException($this->container->requestobj, $this->container->responseobj); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Receives N parameters and sends them to the console adding where was it called from |
||
| 23 | * @return null |
||
|
1 ignored issue
–
show
|
|||
| 24 | */ |
||
| 25 | public function prtrace() |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Receives N parameters and sends them to the console adding where was it |
||
| 61 | * called from |
||
| 62 | * @return null |
||
|
1 ignored issue
–
show
|
|||
| 63 | */ |
||
| 64 | public static function statictrace() |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Returns a string with html <br> variant replaced with a new line |
||
| 84 | * |
||
| 85 | * @param string $msg message to convert |
||
| 86 | * |
||
| 87 | * @return string converted message |
||
| 88 | */ |
||
| 89 | public static function br2ln(string $msg) |
||
| 94 |