Passed
Push — master ( 102376...acba12 )
by 世昌
03:37
created
suda/src/framework/Event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
      * @return Iterator
121 121
      */
122 122
     protected function getCallbackIterator(string $name, bool $reverse = false): Iterator {
123
-        return $reverse?new ArrayIterator(array_reverse($this->queue[$name])):new ArrayIterator($this->queue[$name]);
123
+        return $reverse ? new ArrayIterator(array_reverse($this->queue[$name])) : new ArrayIterator($this->queue[$name]);
124 124
     }
125 125
 
126 126
     /**
Please login to merge, or discard this patch.
suda/src/framework/Debugger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,9 +65,9 @@
 block discarded – undo
65 65
                 $desc = $info['description'];
66 66
                 $ms = number_format($time * 1000, 3, '.', '');
67 67
                 if (strlen($desc)) {
68
-                    $timing[] = $name . ';desc="' . $desc . '";dur=' . $ms;
68
+                    $timing[] = $name.';desc="'.$desc.'";dur='.$ms;
69 69
                 } else {
70
-                    $timing[] = $name . ';dur=' . $ms;
70
+                    $timing[] = $name.';dur='.$ms;
71 71
                 }
72 72
             }
73 73
             $response->setHeader('server-timing', implode(',', $timing));
Please login to merge, or discard this patch.
suda/src/database/connection/Connection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->config = $config;
79 79
         $this->name = $name ?? 'anonymous';
80 80
         $this->observer = new NullObserver;
81
-        register_shutdown_function(function () {
81
+        register_shutdown_function(function() {
82 82
             $this->onBeforeSystemShutdown();
83 83
         });
84 84
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 $this->pdo = $this->createPDO();
109 109
                 $this->observer->connectDatabase(microtime(true) - $time);
110 110
                 $this->id = static::$connectionCount;
111
-                static::$connectionCount ++;
111
+                static::$connectionCount++;
112 112
             } catch (PDOException $e) {
113 113
                 throw new SQLException(sprintf(
114 114
                     "%s connect database error:%s",
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     public function beginTransaction()
201 201
     {
202 202
         $this->prepareConnection();
203
-        $this->transaction ++;
203
+        $this->transaction++;
204 204
         if ($this->transaction == 1) {
205 205
             $this->pdo->beginTransaction();
206 206
         }
Please login to merge, or discard this patch.
suda/loader/main.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,25 +8,25 @@  discard block
 block discarded – undo
8 8
 use suda\application\builder\ApplicationBuilder;
9 9
 use suda\framework\http\HTTPResponse as Response;
10 10
 
11
-require_once __DIR__ . '/loader.php';
11
+require_once __DIR__.'/loader.php';
12 12
 
13 13
 // 初始化系统加载器
14 14
 $loader = new Loader;
15 15
 $loader->register();
16
-$loader->addIncludePath(SUDA_SYSTEM . '/src', 'suda');
16
+$loader->addIncludePath(SUDA_SYSTEM.'/src', 'suda');
17 17
 // 初始化数据目录
18 18
 defined('SUDA_DATA') or define('SUDA_DATA', Path::toAbsolutePath('~/data'));
19
-defined('SUDA_APP_MANIFEST') or define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest');
19
+defined('SUDA_APP_MANIFEST') or define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest');
20 20
 $application = ApplicationBuilder::build($loader, SUDA_APP, SUDA_APP_MANIFEST, SUDA_DATA);
21 21
 // 日志路径
22
-defined('SUDA_DEBUG_LOG_PATH') or define('SUDA_DEBUG_LOG_PATH', $application->getDataPath() . '/logs');
22
+defined('SUDA_DEBUG_LOG_PATH') or define('SUDA_DEBUG_LOG_PATH', $application->getDataPath().'/logs');
23 23
 // 文件日志
24 24
 $logger = new FileLogger(
25 25
     [
26 26
         'log-level' => SUDA_DEBUG_LEVEL,
27 27
         'save-path' => SUDA_DEBUG_LOG_PATH,
28
-        'save-dump-path' => SUDA_DEBUG_LOG_PATH . '/dump',
29
-        'save-zip-path' => SUDA_DEBUG_LOG_PATH . '/zip',
28
+        'save-dump-path' => SUDA_DEBUG_LOG_PATH.'/dump',
29
+        'save-zip-path' => SUDA_DEBUG_LOG_PATH.'/zip',
30 30
         'log-format' => '%message%',
31 31
     ]
32 32
 );
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     'start-time' => defined('SUDA_START_TIME') ? constant('SUDA_START_TIME') : microtime(true),
38 38
     'start-memory' => defined('SUDA_START_MEMORY') ? constant('SUDA_START_MEMORY') : memory_get_usage(),
39 39
 ]);
40
-$application->getConfig()->set('save-dump-path', SUDA_DEBUG_LOG_PATH .'/dump');
40
+$application->getConfig()->set('save-dump-path', SUDA_DEBUG_LOG_PATH.'/dump');
41 41
 $application->getConfig()->set('response-timing', SUDA_DEBUG);
42 42
 $application->run(Request::create(), new Response);
43 43
 exit;
Please login to merge, or discard this patch.
suda/src/application/loader/ApplicationLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function loadVendorIfExist()
28 28
     {
29
-        $vendorAutoload = $this->application->getPath() . '/vendor/autoload.php';
29
+        $vendorAutoload = $this->application->getPath().'/vendor/autoload.php';
30 30
         if (FileSystem::exist($vendorAutoload)) {
31 31
             Loader::requireOnce($vendorAutoload);
32 32
         }
Please login to merge, or discard this patch.
suda/src/application/loader/ApplicationModuleLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@
 block discarded – undo
178 178
      */
179 179
     private function registerModule()
180 180
     {
181
-        $extractPath = $this->application->getDataPath() . '/extract-module';
181
+        $extractPath = $this->application->getDataPath().'/extract-module';
182 182
         FileSystem::make($extractPath);
183 183
         foreach ($this->application->getModulePaths() as $path) {
184 184
             $this->registerModuleFrom($path, $extractPath);
Please login to merge, or discard this patch.
suda/src/database/statement/PrepareTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             $fields = $reads;
28 28
         } else {
29 29
             $field = [];
30
-            $prefix = strlen($table) ?"`{$table}`." :'';
30
+            $prefix = strlen($table) ? "`{$table}`." : '';
31 31
             foreach ($reads as $want) {
32 32
                 $field[] = $prefix."`$want`";
33 33
             }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     protected function mergeBinder(array $binderArray, array $parameter)
66 66
     {
67 67
         foreach ($parameter as $key => $value) {
68
-            if (! ($value instanceof Binder)) {
68
+            if (!($value instanceof Binder)) {
69 69
                 $value = new Binder($key, $value);
70 70
             }
71 71
             if (!in_array($value, $binderArray)) {
Please login to merge, or discard this patch.
suda/src/database/statement/WherePrepareTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function prepareQueryMark(string $sql, array $parameter)
23 23
     {
24 24
         $binders = [];
25
-        $query = preg_replace_callback('/\?/', function ($match) use (&$binders, $parameter) {
25
+        $query = preg_replace_callback('/\?/', function($match) use (&$binders, $parameter) {
26 26
             $index = count($binders);
27 27
             if (array_key_exists($index, $parameter)) {
28 28
                 $name = Binder::index($index);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                 } else {
34 34
                     $binder = new Binder($name, $parameter[$index]);
35 35
                     $binders[] = $binder;
36
-                    return ':' . $binder->getName();
36
+                    return ':'.$binder->getName();
37 37
                 }
38 38
             }
39 39
             return $match[0];
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
     public function prepareInParameter($values, string $name)
52 52
     {
53 53
         if ($this->count($values) <= 0) {
54
-            throw new SQLException('on field ' . $name . ' value can\'t be empty array');
54
+            throw new SQLException('on field '.$name.' value can\'t be empty array');
55 55
         }
56 56
         $names = [];
57 57
         $binders = [];
58 58
         foreach ($values as $value) {
59 59
             $_name = Binder::index($name);
60 60
             $binders[] = new Binder($_name, $value);
61
-            $names[] = ':' . $_name;
61
+            $names[] = ':'.$_name;
62 62
         }
63 63
         return [implode(',', $names), $binders];
64 64
     }
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
     public function createQueryOperation(string $name, string $operation, $value, string $indexName = '')
87 87
     {
88 88
         if ($value instanceof Query) {
89
-            return new Query("`{$name}` {$operation} " . $value, $value->getBinder());
89
+            return new Query("`{$name}` {$operation} ".$value, $value->getBinder());
90 90
         }
91 91
         if ($value instanceof Statement) {
92
-            return new Query("`{$name}` {$operation} (" . $value->getQuery() . ')', $value->getBinder());
92
+            return new Query("`{$name}` {$operation} (".$value->getQuery().')', $value->getBinder());
93 93
         }
94 94
         if ($value instanceof IteratorAggregate || is_array($value)) {
95 95
             return $this->prepareIn($name, $operation, $value);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             return $this->createQueryOperation($name, 'in', $values);
191 191
         }
192 192
         list($inSQL, $binders) = $this->prepareInParameter($values, $name);
193
-        $sql = '`' . $name . '` ' . strtoupper($operation) . ' (' . $inSQL . ')';
193
+        $sql = '`'.$name.'` '.strtoupper($operation).' ('.$inSQL.')';
194 194
         return new Query($sql, $binders);
195 195
     }
196 196
 
@@ -205,6 +205,6 @@  discard block
 block discarded – undo
205 205
     public function replaceQuote(string $name, string $replace, string $target)
206 206
     {
207 207
         $name = ltrim($name, ':');
208
-        return preg_replace('/(?<!_):' . preg_quote($name) . '/', $replace, $target);
208
+        return preg_replace('/(?<!_):'.preg_quote($name).'/', $replace, $target);
209 209
     }
210 210
 }
211 211
\ No newline at end of file
Please login to merge, or discard this patch.
suda/src/database/statement/WriteStatement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,10 +210,10 @@
 block discarded – undo
210 210
                     list($updateSet, $upBinder) = $this->prepareUpdateSet($this->data);
211 211
                     $this->binder = array_merge($this->binder, $upBinder);
212 212
                 }
213
-                $string = "UPDATE " . $this->table . " SET " . $updateSet . " WHERE " . $this->whereCondition;
213
+                $string = "UPDATE ".$this->table." SET ".$updateSet." WHERE ".$this->whereCondition;
214 214
                 return new Query($string, $this->binder);
215 215
             } else {
216
-                $string = "DELETE FROM " . $this->table . " WHERE " . $this->whereCondition;
216
+                $string = "DELETE FROM ".$this->table." WHERE ".$this->whereCondition;
217 217
                 return new Query($string, $this->binder);
218 218
             }
219 219
         }
Please login to merge, or discard this patch.