Completed
Push — v7 ( 4c8ab7...4dd6c2 )
by Georges
01:44
created
lib/Phpfastcache/Util/ClassNamespaceResolverTrait.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Util;
17 17
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         }
56 56
         $map = [];
57 57
 
58
-        if(\is_array($dir) || $dir instanceof \Traversable){
58
+        if (\is_array($dir) || $dir instanceof \Traversable) {
59 59
             foreach ($dir as $file) {
60 60
                 if (!$file->isFile()) {
61 61
                     continue;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                     gc_mem_caches();
71 71
                 }
72 72
                 foreach ($classes as $class) {
73
-                    $map[ $class ] = $path;
73
+                    $map[$class] = $path;
74 74
                 }
75 75
             }
76 76
         }
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
         $tokens = token_get_all($contents);
95 95
         $classes = [];
96 96
         $namespace = '';
97
-        for ($i = 0; isset($tokens[ $i ]); ++$i) {
98
-            $token = $tokens[ $i ];
99
-            if (!isset($token[ 1 ])) {
97
+        for ($i = 0; isset($tokens[$i]); ++$i) {
98
+            $token = $tokens[$i];
99
+            if (!isset($token[1])) {
100 100
                 continue;
101 101
             }
102 102
             $class = '';
103
-            switch ($token[ 0 ]) {
103
+            switch ($token[0]) {
104 104
                 case T_NAMESPACE:
105 105
                     $namespace = '';
106 106
                     // If there is a namespace, extract it
107
-                    while (isset($tokens[ ++$i ][ 1 ])) {
108
-                        if (in_array($tokens[ $i ][ 0 ], [T_STRING, T_NS_SEPARATOR])) {
109
-                            $namespace .= $tokens[ $i ][ 1 ];
107
+                    while (isset($tokens[ ++$i][1])) {
108
+                        if (in_array($tokens[$i][0], [T_STRING, T_NS_SEPARATOR])) {
109
+                            $namespace .= $tokens[$i][1];
110 110
                         }
111 111
                     }
112 112
                     $namespace .= '\\';
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
                     // Skip usage of ::class constant
118 118
                     $isClassConstant = false;
119 119
                     for ($j = $i - 1; $j > 0; --$j) {
120
-                        if (!isset($tokens[ $j ][ 1 ])) {
120
+                        if (!isset($tokens[$j][1])) {
121 121
                             break;
122 122
                         }
123
-                        if (T_DOUBLE_COLON === $tokens[ $j ][ 0 ]) {
123
+                        if (T_DOUBLE_COLON === $tokens[$j][0]) {
124 124
                             $isClassConstant = true;
125 125
                             break;
126
-                        } elseif (!\in_array($tokens[ $j ][ 0 ], [T_WHITESPACE, T_DOC_COMMENT, T_COMMENT], false)) {
126
+                        } elseif (!\in_array($tokens[$j][0], [T_WHITESPACE, T_DOC_COMMENT, T_COMMENT], false)) {
127 127
                             break;
128 128
                         }
129 129
                     }
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
                         break;
132 132
                     }
133 133
                     // Find the classname
134
-                    while (isset($tokens[ ++$i ][ 1 ])) {
135
-                        $t = $tokens[ $i ];
136
-                        if (T_STRING === $t[ 0 ]) {
137
-                            $class .= $t[ 1 ];
138
-                        } elseif ('' !== $class && T_WHITESPACE === $t[ 0 ]) {
134
+                    while (isset($tokens[ ++$i][1])) {
135
+                        $t = $tokens[$i];
136
+                        if (T_STRING === $t[0]) {
137
+                            $class .= $t[1];
138
+                        } elseif ('' !== $class && T_WHITESPACE === $t[0]) {
139 139
                             break;
140 140
                         }
141 141
                     }
Please login to merge, or discard this patch.
lib/Phpfastcache/Exceptions/PhpfastcacheUnsupportedOperationException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @author Georges.L (Geolim4)  <[email protected]>
12 12
  *
13 13
  */
14
-declare(strict_types=1);
14
+declare(strict_types = 1);
15 15
 
16 16
 namespace Phpfastcache\Exceptions;
17 17
 
Please login to merge, or discard this patch.