Passed
Push — dev ( b901d7...f65c5c )
by 世昌
03:08
created
suda/loader/swoole.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . '/loader.php';
2
+require_once __DIR__.'/loader.php';
3 3
 
4 4
 use suda\framework\debug\log\logger\NullLogger;
5 5
 use Swoole\Http\Server;
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 // 初始化系统加载器
19 19
 $loader = new Loader;
20 20
 $loader->register();
21
-$loader->addIncludePath(SUDA_SYSTEM . '/src', 'suda');
21
+$loader->addIncludePath(SUDA_SYSTEM.'/src', 'suda');
22 22
 // 创建应用
23 23
 $application = ApplicationBuilder::build($loader, SUDA_APP, SUDA_APP_MANIFEST, SUDA_DATA);
24 24
 // 不复制资源
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
     'log_file' => $logger->getConfig('save-dump-path').'/swoole.log',
43 43
 ]);
44 44
 
45
-$application->config()->set('save-dump-path', SUDA_DEBUG_LOG_PATH . '/dump');
45
+$application->config()->set('save-dump-path', SUDA_DEBUG_LOG_PATH.'/dump');
46 46
 $application->config()->set('response-timing', SUDA_DEBUG);
47 47
 
48 48
 $application->setDebug(new Debugger($application, new NullLogger()));
49 49
 
50
-$http->on('request', function ($request, $response) use ($application, $logger) {
50
+$http->on('request', function($request, $response) use ($application, $logger) {
51 51
     // 拷贝副本
52 52
     $runApplication = clone $application;
53 53
     $runLogger = clone $logger;
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/application/LanguageBag.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      *
12 12
      * @var array
13 13
      */
14
-    private $locales=[];
14
+    private $locales = [];
15 15
 
16 16
     /**
17 17
      * 包含本地化语言数组
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function format(string $text, array $param)
52 52
     {
53
-        return preg_replace_callback('/(?<!\$)\$(\{)?(\d+|\w+?\b)(?(1)\})/', function ($match) use ($param) {
53
+        return preg_replace_callback('/(?<!\$)\$(\{)?(\d+|\w+?\b)(?(1)\})/', function($match) use ($param) {
54 54
             $key = $match[2];
55 55
             if (array_key_exists($key, $param)) {
56 56
                 return strval($param[$key]);
Please login to merge, or discard this patch.
suda/src/application/Application.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     protected function prepare(Request $request, Response $response)
85 85
     {
86 86
 
87
-        $response->setHeader('x-powered-by', 'suda/' . SUDA_VERSION, true);
87
+        $response->setHeader('x-powered-by', 'suda/'.SUDA_VERSION, true);
88 88
         $response->getWrapper()->register(ExceptionContentWrapper::class, [Throwable::class]);
89 89
         $response->getWrapper()->register(TemplateWrapper::class, [RawTemplate::class]);
90 90
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $init = $this->debug->timeEnd('init');
128 128
             $this->debug->recordTiming('init', $init, 'init total');
129 129
             $this->debug->time('match route');
130
-            $result = $this->route->match($appRequest->getMethod(),  $appRequest->getUri());
130
+            $result = $this->route->match($appRequest->getMethod(), $appRequest->getUri());
131 131
             $match = $this->debug->timeEnd('match route');
132 132
             $this->debug->recordTiming('dispatch', $match);
133 133
             if ($result !== null) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             if (!$appResponse->isSend()) {
139 139
                 $appResponse->end();
140 140
             }
141
-            $this->debug->info('responded with code ' . $appResponse->getStatus());
141
+            $this->debug->info('responded with code '.$appResponse->getStatus());
142 142
             $this->debug->timeEnd('sending response');
143 143
         } catch (Throwable $e) {
144 144
             $this->debug->uncaughtException($e);
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
         $route = $attributes['config'] ?? [];
164 164
         $runnable = null;
165 165
         if (array_key_exists('class', $route)) {
166
-            $runnable = $this->className($route['class']) . '->onRequest';
166
+            $runnable = $this->className($route['class']).'->onRequest';
167 167
         } elseif (array_key_exists('source', $route)) {
168 168
             $attributes['source'] = $route['source'];
169
-            $runnable = FileRequestProcessor::class . '->onRequest';
169
+            $runnable = FileRequestProcessor::class.'->onRequest';
170 170
         } elseif (array_key_exists('template', $route)) {
171 171
             $attributes['template'] = $route['template'];
172
-            $runnable = TemplateRequestProcessor::class . '->onRequest';
172
+            $runnable = TemplateRequestProcessor::class.'->onRequest';
173 173
         } elseif (array_key_exists('runnable', $route)) {
174 174
             $runnable = $route['runnable'];
175 175
         } else {
Please login to merge, or discard this patch.
suda/src/framework/route/RouteMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function __construct(array $methods, string $uri, array $attribute = [])
45 45
     {
46
-        array_walk($methods, function ($value) {
46
+        array_walk($methods, function($value) {
47 47
             return strtoupper($value);
48 48
         });
49 49
         $this->methods = $methods;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param string $uri
161 161
      * @return array|null
162 162
      */
163
-    public function match(string $method, string $uri):?array
163
+    public function match(string $method, string $uri): ?array
164 164
     {
165 165
         if (count($this->methods) > 0 && !in_array($method, $this->methods)) {
166 166
             return null;
Please login to merge, or discard this patch.