Passed
Push — dev ( f395b9...2c49a0 )
by 世昌
04:46
created
suda/src/framework/debug/Debug.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         $replace = [];
84 84
         $attach  = [];
85 85
         foreach ($context as $key => $val) {
86
-            $replaceKey = '{' . $key . '}';
86
+            $replaceKey = '{'.$key.'}';
87 87
             if ($this->canBeStringValue($val) && strpos($message, $replaceKey) !== false) {
88
-                $replace['{' . $key . '}'] = $val;
88
+                $replace['{'.$key.'}'] = $val;
89 89
             } else {
90 90
                 $attach[$key] = $val;
91 91
             }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $pow   = floor(($bytes ? log($bytes) : 0) / log(1024));
152 152
         $pos   = min($pow, count($human) - 1);
153 153
         $bytes /= (1 << (10 * $pos));
154
-        return round($bytes, $precision) . ' ' . $human[$pos];
154
+        return round($bytes, $precision).' '.$human[$pos];
155 155
     }
156 156
 
157 157
     /**
Please login to merge, or discard this patch.
suda/src/framework/debug/Caller.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     protected $ignorePath = [__FILE__];
13 13
     protected $backtrace;
14 14
 
15
-    public function __construct(array $backtrace, array $ignorePath =[])
15
+    public function __construct(array $backtrace, array $ignorePath = [])
16 16
     {
17 17
         $this->ignorePath = array_merge($this->ignorePath, $ignorePath);
18 18
         $rc = new \ReflectionClass(LoggerTrait::class);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->backtrace = $backtrace;
24 24
     }
25 25
 
26
-    public function getCallerTrace():?array
26
+    public function getCallerTrace(): ?array
27 27
     {
28 28
         foreach ($this->backtrace as $trace) {
29 29
             if (array_key_exists('file', $trace)) {
Please login to merge, or discard this patch.
suda/src/database/statement/WherePrepareTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function prepareQueryMark(string $sql, array $parameter)
22 22
     {
23 23
         $binders = [];
24
-        $query = preg_replace_callback('/\?/', function ($match) use (&$binders, $parameter) {
24
+        $query = preg_replace_callback('/\?/', function($match) use (&$binders, $parameter) {
25 25
             $index = count($binders);
26 26
             if (array_key_exists($index, $parameter)) {
27 27
                 $name = Binder::index($index);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                 } else {
33 33
                     $binder = new Binder($name, $parameter[$index]);
34 34
                     $binders[] = $binder;
35
-                    return ':' . $binder->getName();
35
+                    return ':'.$binder->getName();
36 36
                 }
37 37
             }
38 38
             return $match[0];
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
     public function prepareInParameter($values, string $name)
51 51
     {
52 52
         if ($this->countObject($values) <= 0) {
53
-            throw new SQLException('on field ' . $name . ' value can\'t be empty array');
53
+            throw new SQLException('on field '.$name.' value can\'t be empty array');
54 54
         }
55 55
         $names = [];
56 56
         $binders = [];
57 57
         foreach ($values as $value) {
58 58
             $_name = Binder::index($name);
59 59
             $binders[] = new Binder($_name, $value);
60
-            $names[] = ':' . $_name;
60
+            $names[] = ':'.$_name;
61 61
         }
62 62
         return [implode(',', $names), $binders];
63 63
     }
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
     public function createQueryOperation(string $name, string $operator, $value, string $indexName = '')
86 86
     {
87 87
         if ($value instanceof Query) {
88
-            return new Query("`{$name}` {$operator} " . $value, $value->getBinder());
88
+            return new Query("`{$name}` {$operator} ".$value, $value->getBinder());
89 89
         }
90 90
         if ($value instanceof Statement) {
91
-            return new Query("`{$name}` {$operator} (" . $value->getQuery() . ')', $value->getBinder());
91
+            return new Query("`{$name}` {$operator} (".$value->getQuery().')', $value->getBinder());
92 92
         }
93 93
         if ($value instanceof IteratorAggregate || is_array($value)) {
94 94
             return $this->prepareIn($name, $operator, $value);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     protected function fixWhereArray(array $item) {
161 161
         if (count($item) === 2) {
162 162
             [$name, $value] = $item;
163
-            $op = $this->isArray($value)?'in':'=';
163
+            $op = $this->isArray($value) ? 'in' : '=';
164 164
             return [$name, $op, $value];
165 165
         }
166 166
         return $item;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             if (is_array($value)) {
181 181
                 $newWhere[] = [$name, $value[0], $value[1]];
182 182
             } else {
183
-                $op = $this->isArray($value)?'in':'=';
183
+                $op = $this->isArray($value) ? 'in' : '=';
184 184
                 $newWhere[] = [$name, $op, $value];
185 185
             }
186 186
         }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             return $this->createQueryOperation($name, 'in', $values);
240 240
         }
241 241
         [$inSQL, $binders] = $this->prepareInParameter($values, $name);
242
-        $sql = '`' . $name . '` ' . strtoupper($operation) . ' (' . $inSQL . ')';
242
+        $sql = '`'.$name.'` '.strtoupper($operation).' ('.$inSQL.')';
243 243
         return new Query($sql, $binders);
244 244
     }
245 245
 
@@ -254,6 +254,6 @@  discard block
 block discarded – undo
254 254
     public function replaceQuote(string $name, string $replace, string $target)
255 255
     {
256 256
         $name = ltrim($name, ':');
257
-        return preg_replace('/(?<!_):' . preg_quote($name) . '/', $replace, $target);
257
+        return preg_replace('/(?<!_):'.preg_quote($name).'/', $replace, $target);
258 258
     }
259 259
 }
Please login to merge, or discard this patch.
suda/src/application/Application.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function prepare(Request $request, Response $response)
65 65
     {
66
-        $response->setHeader('x-powered-by', 'suda/' . SUDA_VERSION, true);
66
+        $response->setHeader('x-powered-by', 'suda/'.SUDA_VERSION, true);
67 67
         $response->getWrapper()->register(ExceptionContentWrapper::class, [Throwable::class]);
68 68
         $response->getWrapper()->register(TemplateWrapper::class, [RawTemplate::class]);
69 69
         $this->setCatcher(new RequestDumpCatcher($this, $request, $response));
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             if (!$appResponse->isSend()) {
127 127
                 $appResponse->end();
128 128
             }
129
-            $this->debug->info('responded with code ' . $appResponse->getStatus());
129
+            $this->debug->info('responded with code '.$appResponse->getStatus());
130 130
             $this->debug->timeEnd('sending response');
131 131
         } catch (Throwable $e) {
132 132
             $this->debug->uncaughtException($e);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function request(array $method, string $name, string $url, array $attributes = [])
150 150
     {
151 151
         $route = $attributes['config'] ?? [];
152
-        $runnable = RunnableRequestProcessor::class . '->onRequest';
152
+        $runnable = RunnableRequestProcessor::class.'->onRequest';
153 153
         if (array_key_exists('class', $route)) {
154 154
             $attributes['class'] = $route['class'];
155 155
         } elseif (array_key_exists('source', $route)) {
Please login to merge, or discard this patch.
public/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2
-define('SUDA_APP', __DIR__ . '/../app');
3
-define('SUDA_DATA', __DIR__ . '/../data');
4
-define('SUDA_SYSTEM', __DIR__ . '/../suda');
2
+define('SUDA_APP', __DIR__.'/../app');
3
+define('SUDA_DATA', __DIR__.'/../data');
4
+define('SUDA_SYSTEM', __DIR__.'/../suda');
5 5
 define('SUDA_PUBLIC', __DIR__);
6 6
 define('SUDA_DEBUG', true);
7 7
 define('SUDA_DEBUG_LEVEL', 'info');
8 8
 
9
-if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
10
-    require_once __DIR__ . '/../vendor/autoload.php';
9
+if (file_exists(__DIR__.'/../vendor/autoload.php')) {
10
+    require_once __DIR__.'/../vendor/autoload.php';
11 11
 } else {
12 12
     die('please run <b>composer install</b> to install requirements');
13 13
 }
14 14
 
15
-require_once SUDA_SYSTEM . '/loader/main.php';
15
+require_once SUDA_SYSTEM.'/loader/main.php';
16 16
 
17 17
 
Please login to merge, or discard this patch.
suda/src/application/ModuleBag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
         if (array_key_exists($version, $this->version[$shortName])) {
215 215
             return $this->version[$shortName][$version];
216 216
         }
217
-        return $hasVersion ? $shortName . ':' . $version : end($this->version[$shortName]);
217
+        return $hasVersion ? $shortName.':'.$version : end($this->version[$shortName]);
218 218
     }
219 219
 
220 220
     protected function getLikeName(string $name): string
Please login to merge, or discard this patch.