Completed
Push — master ( 6cefe1...5ffb76 )
by Kamil
02:56 queued 14s
created
src/Throwable/Throwable.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      * @param \Error|\Exception $ex
37 37
      * @param string[] &$data
38 38
      * @param int $offset
39
-     * @return mixed
39
+     * @return string[]
40 40
      */
41 41
     public static function getThrowableStack($ex, &$data = [], $offset = 0)
42 42
     {
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
      */
13 13
     public static function parseThrowableMessage($ex)
14 14
     {
15
-        $message = $ex['message'];
15
+        $message = $ex[ 'message' ];
16 16
 
17
-        if ($ex['isError'] && strpos($message, ' in ') !== false)
17
+        if ($ex[ 'isError' ] && strpos($message, ' in ') !== false)
18 18
         {
19 19
             $message = preg_replace('#([a-zA-Z0-9-_]+?)/#siU', '', $message);
20 20
             $message = preg_replace('#/#si', '', $message, 1);
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
         else
23 23
         {
24 24
             $message = trim($message, '"');
25
-            $file = str_replace('.php', '', basename($ex['file']));
26
-            $line = $ex['line'];
25
+            $file = str_replace('.php', '', basename($ex[ 'file' ]));
26
+            $line = $ex[ 'line' ];
27 27
             $message = '"' . $message . '" in ' . $file . ':' . $line;
28 28
         }
29 29
 
30
-        return '[' . static::getBasename($ex['class']) . '] ' . $message;
30
+        return '[' . static::getBasename($ex[ 'class' ]) . '] ' . $message;
31 31
     }
32 32
 
33 33
     /**
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
      * @param int $offset
39 39
      * @return mixed
40 40
      */
41
-    public static function getThrowableStack($ex, &$data = [], $offset = 0)
41
+    public static function getThrowableStack($ex, &$data = [ ], $offset = 0)
42 42
     {
43 43
         $data = static::getThrowableData($ex, $offset);
44 44
 
45 45
         if (($current = $ex->getPrevious()) !== null)
46 46
         {
47
-            static::getThrowableStack($current, $data['prev'], count(static::getTraceElements($ex)));
47
+            static::getThrowableStack($current, $data[ 'prev' ], count(static::getTraceElements($ex)));
48 48
         }
49 49
 
50 50
         return $data;
@@ -81,16 +81,16 @@  discard block
 block discarded – undo
81 81
         $trace = $ex->getTrace();
82 82
         $file  = str_replace('.php', '', basename($ex->getFile()));
83 83
         $elements = [
84
-            '[throwable] ' . get_class($ex) . '(...) in ' . $file .':' . $ex->getLine()
84
+            '[throwable] ' . get_class($ex) . '(...) in ' . $file . ':' . $ex->getLine()
85 85
         ];
86 86
 
87 87
         foreach ($trace as $currentTrack)
88 88
         {
89
-            $elements[] = static::parseTraceElement($currentTrack);
89
+            $elements[ ] = static::parseTraceElement($currentTrack);
90 90
         }
91
-        $elements[] = '[main]';
91
+        $elements[ ] = '[main]';
92 92
 
93
-        array_splice($elements, -$offset+1, $offset);
93
+        array_splice($elements, -$offset + 1, $offset);
94 94
 
95 95
         return $elements;
96 96
     }
@@ -101,24 +101,24 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected static function parseTraceElement($element)
103 103
     {
104
-        $element['class']    = isset($element['class'])    ? $element['class']    : 'Undefined';
105
-        $element['file']     = isset($element['file'])     ? $element['file']     : 'unknown';
106
-        $element['line']     = isset($element['line'])     ? $element['line']     : 0;
107
-        $element['type']     = isset($element['type'])     ? $element['type']     : '';
108
-        $element['function'] = isset($element['function']) ? $element['function'] : '::undefined';
109
-        $element['args']     = isset($element['args'])     ? $element['args']     : [];
104
+        $element[ 'class' ]    = isset($element[ 'class' ]) ? $element[ 'class' ] : 'Undefined';
105
+        $element[ 'file' ]     = isset($element[ 'file' ]) ? $element[ 'file' ] : 'unknown';
106
+        $element[ 'line' ]     = isset($element[ 'line' ]) ? $element[ 'line' ] : 0;
107
+        $element[ 'type' ]     = isset($element[ 'type' ]) ? $element[ 'type' ] : '';
108
+        $element[ 'function' ] = isset($element[ 'function' ]) ? $element[ 'function' ] : '::undefined';
109
+        $element[ 'args' ]     = isset($element[ 'args' ]) ? $element[ 'args' ] : [ ];
110 110
 
111 111
         return implode('', [
112 112
             '[call] ',
113
-            $element['class'],
114
-            $element['type'],
115
-            $element['function'],
113
+            $element[ 'class' ],
114
+            $element[ 'type' ],
115
+            $element[ 'function' ],
116 116
             '(',
117
-            static::parseArgs($element['args']),
117
+            static::parseArgs($element[ 'args' ]),
118 118
             ') in ',
119
-            str_replace('.php', '', basename($element['file'])),
119
+            str_replace('.php', '', basename($element[ 'file' ])),
120 120
             ':',
121
-            $element['line']
121
+            $element[ 'line' ]
122 122
         ]);
123 123
     }
124 124
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     protected static function parseArgs($args)
130 130
     {
131
-        $elements = [];
131
+        $elements = [ ];
132 132
 
133 133
         foreach ($args as $element)
134 134
         {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 $element = '"' . $element . '"';
147 147
             }
148 148
 
149
-            $elements[] = $element;
149
+            $elements[ ] = $element;
150 150
         }
151 151
 
152 152
         return implode(', ', $elements);
Please login to merge, or discard this patch.
src/Throwable/ThrowableProxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@
 block discarded – undo
47 47
         }
48 48
         else if (is_array($throwableOrMessage))
49 49
         {
50
-            $this->class = $throwableOrMessage[0];
51
-            $this->message = $throwableOrMessage[1];
50
+            $this->class = $throwableOrMessage[ 0 ];
51
+            $this->message = $throwableOrMessage[ 1 ];
52 52
             $this->prev = null;
53 53
         }
54 54
         else
Please login to merge, or discard this patch.
src/Throwable/Exception.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public static function toStackTrace($ex)
58 58
     {
59
-        $list = [];
60
-        for ($stack = Throwable::getThrowableStack($ex); $stack !== null; $stack = $stack['prev'])
59
+        $list = [ ];
60
+        for ($stack = Throwable::getThrowableStack($ex); $stack !== null; $stack = $stack[ 'prev' ])
61 61
         {
62
-            $list = array_merge($stack['trace'], $list);
62
+            $list = array_merge($stack[ 'trace' ], $list);
63 63
         }
64 64
 
65 65
         return $list;
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public static function toThrowableTrace($ex)
75 75
     {
76
-        $list = [];
77
-        for ($stack = Throwable::getThrowableStack($ex); $stack !== null; $stack = $stack['prev'])
76
+        $list = [ ];
77
+        for ($stack = Throwable::getThrowableStack($ex); $stack !== null; $stack = $stack[ 'prev' ])
78 78
         {
79
-            $list[] = Throwable::parseThrowableMessage($stack);
79
+            $list[ ] = Throwable::parseThrowableMessage($stack);
80 80
         }
81 81
 
82 82
         return array_reverse($list);
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public static function toStackString($ex)
92 92
     {
93
-        $stack = [];
93
+        $stack = [ ];
94 94
         $i = 0;
95 95
         $trace = static::toStackTrace($ex);
96 96
         $pad = strlen(count($trace)) > 2 ?: 2;
97 97
 
98 98
         foreach ($trace as $element)
99 99
         {
100
-            $stack[] = "\t" . str_pad('' . $i, $pad, ' ', STR_PAD_LEFT) . '. ' . $element;
100
+            $stack[ ] = "\t" . str_pad('' . $i, $pad, ' ', STR_PAD_LEFT) . '. ' . $element;
101 101
             ++$i;
102 102
         }
103 103
 
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public static function toThrowableString($ex)
114 114
     {
115
-        $stack = [];
115
+        $stack = [ ];
116 116
         $i = 0;
117 117
         $trace = static::toThrowableTrace($ex);
118 118
         $pad = strlen(count($trace)) > 2 ?: 2;
119 119
 
120 120
         foreach ($trace as $element)
121 121
         {
122
-            $stack[] = "\t" . str_pad('' . $i, $pad, ' ', STR_PAD_LEFT) . '. ' . $element;
122
+            $stack[ ] = "\t" . str_pad('' . $i, $pad, ' ', STR_PAD_LEFT) . '. ' . $element;
123 123
             ++$i;
124 124
         }
125 125
 
Please login to merge, or discard this patch.
src/Throwable/Exception/SystemException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception;
6 6
 
7 7
 class SystemException extends Exception
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Throwable/Exception/System/TaskIncompleteException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception\SystemException;
6 6
 
7 7
 class TaskIncompleteException extends SystemException
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Throwable/Exception/System/ChildUnresponsiveException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception\SystemException;
6 6
 
7 7
 class ChildUnresponsiveException extends SystemException
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Throwable/Exception/System/ParentUnresponsiveException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception\SystemException;
6 6
 
7 7
 class ParentUnresponsiveException extends SystemException
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Throwable/Exception/LogicException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception;
6 6
 
7 7
 class LogicException extends Exception
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Throwable/Exception/Runtime/TimeoutException.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Dazzle\Throwable\Exception\RuntimeException;
6 6
 
7 7
 class TimeoutException extends RuntimeException
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.