@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | try |
| 26 | 26 | { |
| 27 | 27 | throw new ExceptionException("This is an storable exception"); |
| 28 | - } |
|
| 29 | - catch (ExceptionException $e) |
|
| 28 | + } catch (ExceptionException $e) |
|
| 30 | 29 | { |
| 31 | 30 | mkdir('exceptions'); |
| 32 | 31 | |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | try |
| 65 | 64 | { |
| 66 | 65 | throw new ExceptionException("This is an storable exception too"); |
| 67 | - } |
|
| 68 | - catch (ExceptionException $e) |
|
| 66 | + } catch (ExceptionException $e) |
|
| 69 | 67 | { |
| 70 | 68 | $date = date('dmY'); |
| 71 | 69 | $file = 'nofolder/exception-' . $date . '.json'; |
@@ -95,8 +93,7 @@ discard block |
||
| 95 | 93 | try |
| 96 | 94 | { |
| 97 | 95 | throw new ExceptionException("This is an storable exception"); |
| 98 | - } |
|
| 99 | - catch (ExceptionException $e) |
|
| 96 | + } catch (ExceptionException $e) |
|
| 100 | 97 | { |
| 101 | 98 | $file = 'exceptions/exception-' . $date . '.json'; |
| 102 | 99 | $storage = new \Drone\Exception\Storage($file); |
@@ -106,8 +103,7 @@ discard block |
||
| 106 | 103 | try |
| 107 | 104 | { |
| 108 | 105 | throw new ExceptionException("This is an storable exception too"); |
| 109 | - } |
|
| 110 | - catch (ExceptionException $e) |
|
| 106 | + } catch (ExceptionException $e) |
|
| 111 | 107 | { |
| 112 | 108 | $file = 'exceptions/exception-' . $date . '.json'; |
| 113 | 109 | $storage = new \Drone\Exception\Storage($file); |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | return false; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - } |
|
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | { |
| 75 | 74 | $directory = strstr($this->outputFile, basename($this->outputFile), true); |
| 76 | 75 | |
@@ -86,17 +85,20 @@ discard block |
||
| 86 | 85 | "object" => serialize($exception) |
| 87 | 86 | ]; |
| 88 | 87 | |
| 89 | - if (!function_exists('mb_detect_encoding')) |
|
| 90 | - throw new \RuntimeException("mbstring library is not installed!"); |
|
| 88 | + if (!function_exists('mb_detect_encoding')) { |
|
| 89 | + throw new \RuntimeException("mbstring library is not installed!"); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | 92 | /* |
| 93 | 93 | * Encodes to UTF8 all messages. It ensures JSON encoding. |
| 94 | 94 | */ |
| 95 | - if (!mb_detect_encoding($data[$id]["message"], 'UTF-8', true)) |
|
| 96 | - $data[$id]["message"] = utf8_encode($data[$id]["message"]); |
|
| 95 | + if (!mb_detect_encoding($data[$id]["message"], 'UTF-8', true)) { |
|
| 96 | + $data[$id]["message"] = utf8_encode($data[$id]["message"]); |
|
| 97 | + } |
|
| 97 | 98 | |
| 98 | - if (!mb_detect_encoding($data[$id]["object"], 'UTF-8', true)) |
|
| 99 | - $data[$id]["object"] = utf8_decode($data[$id]["object"]); |
|
| 99 | + if (!mb_detect_encoding($data[$id]["object"], 'UTF-8', true)) { |
|
| 100 | + $data[$id]["object"] = utf8_decode($data[$id]["object"]); |
|
| 101 | + } |
|
| 100 | 102 | |
| 101 | 103 | if (($encoded_data = json_encode($data)) === false) |
| 102 | 104 | { |