@@ -36,6 +36,10 @@ discard block |
||
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param boolean $throwException |
|
| 41 | + * @param string $file |
|
| 42 | + */ |
|
| 39 | 43 | private static function handleUnloadableClass($class, $throwException, $rootPath, $file) |
| 40 | 44 | { |
| 41 | 45 | $debug_backtrace = debug_backtrace(); |
@@ -49,8 +53,8 @@ discard block |
||
| 49 | 53 | |
| 50 | 54 | /** |
| 51 | 55 | * @param $class |
| 52 | - * @param $throwException |
|
| 53 | - * @param $file |
|
| 56 | + * @param boolean $throwException |
|
| 57 | + * @param string $file |
|
| 54 | 58 | * |
| 55 | 59 | * @return bool |
| 56 | 60 | * @throws \Exception |
@@ -76,7 +80,7 @@ discard block |
||
| 76 | 80 | * @param $file |
| 77 | 81 | * @param $debug_backtrace |
| 78 | 82 | * |
| 79 | - * @return bool |
|
| 83 | + * @return null|false |
|
| 80 | 84 | */ |
| 81 | 85 | private static function handleUnloadableClassWithBacktrace($class, $throwException, $rootPath, $file, $debug_backtrace) |
| 82 | 86 | { |
@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function renderError($message = '', $file = '', $line = '', $code = 0, $trace = array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') |
| 23 | 23 | { |
| 24 | - if (ob_get_contents()) ob_end_clean(); |
|
| 24 | + if (ob_get_contents()) { |
|
| 25 | + ob_end_clean(); |
|
| 26 | + } |
|
| 25 | 27 | $line = intval($line); |
| 26 | 28 | |
| 27 | 29 | if (self::canShowError()) { |
@@ -85,7 +87,9 @@ discard block |
||
| 85 | 87 | |
| 86 | 88 | private static function renderCliException($message, $file, $line, $trace, $lines) |
| 87 | 89 | { |
| 88 | - if (ob_get_contents()) ob_end_clean(); |
|
| 90 | + if (ob_get_contents()) { |
|
| 91 | + ob_end_clean(); |
|
| 92 | + } |
|
| 89 | 93 | include(__DIR__ . DIRECTORY_SEPARATOR . 'errortemplates/errorviewcli.php'); |
| 90 | 94 | exit; |
| 91 | 95 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $error = error_get_last(); |
| 35 | 35 | if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
| 36 | 36 | \library\cc\ErrorHandlingUtil::renderError($error['message'],$error['file'],$error['line'], $error['type']); |
| 37 | - }elseif ($error['type'] == 1) { |
|
| 37 | + } elseif ($error['type'] == 1) { |
|
| 38 | 38 | dump($error); |
| 39 | 39 | } |
| 40 | 40 | } |