| @@ 38-56 (lines=19) @@ | ||
| 35 | * |
|
| 36 | * @return void |
|
| 37 | */ |
|
| 38 | protected function defineErrorHandler() |
|
| 39 | { |
|
| 40 | //Find the correct class to call (return the child class if extended) |
|
| 41 | $calledClass = get_called_class(); |
|
| 42 | $errorRender = $calledClass::getErrorRender(); |
|
| 43 | ||
| 44 | //If not render to use |
|
| 45 | if ($errorRender === false) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | //Define the arg for set_error_render |
|
| 50 | //Only "method" if function, of array this class if method. |
|
| 51 | $errorHandlerArgs = $errorRender['method']; |
|
| 52 | if (!empty($errorRender['class'])) { |
|
| 53 | $errorHandlerArgs = [ |
|
| 54 | $errorRender['class'], |
|
| 55 | $errorRender['method'] |
|
| 56 | ]; |
|
| 57 | } |
|
| 58 | ||
| 59 | //add the handler for errors |
|
| @@ 68-86 (lines=19) @@ | ||
| 65 | * |
|
| 66 | * @return type |
|
| 67 | */ |
|
| 68 | protected function defineExceptionHandler() |
|
| 69 | { |
|
| 70 | //Find the correct class to call (return the child class if extended) |
|
| 71 | $calledClass = get_called_class(); |
|
| 72 | $exceptionRender = $calledClass::getExceptionRender(); |
|
| 73 | ||
| 74 | //If not render to use |
|
| 75 | if ($exceptionRender === false) { |
|
| 76 | return; |
|
| 77 | } |
|
| 78 | ||
| 79 | //Define the arg for set_exception_handler |
|
| 80 | //Only "method" if function, of array this class if method. |
|
| 81 | $erxceptionHandlerArgs = $exceptionRender['method']; |
|
| 82 | if (!empty($exceptionRender['class'])) { |
|
| 83 | $erxceptionHandlerArgs = [ |
|
| 84 | $exceptionRender['class'], |
|
| 85 | $exceptionRender['method'] |
|
| 86 | ]; |
|
| 87 | } |
|
| 88 | ||
| 89 | //add the handler for exceptions |
|