Passed
Push — dev ( 059713...8b4395 )
by 世昌
02:28
created
suda/src/application/ApplicationSource.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $group = $group ?? $request->getAttribute('group');
37 37
         $default = $default ?? $request->getAttribute('module');
38 38
         $url = $this->route->create($this->getRouteName($name, $default, $group), $parameter, $allowQuery);
39
-        return $this->getUrlIndex($request) . ltrim($url, '/');
39
+        return $this->getUrlIndex($request).ltrim($url, '/');
40 40
     }
41 41
 
42 42
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             $module = $default;
74 74
         }
75 75
         if ($module !== null && ($moduleObj = $this->find($module))) {
76
-            return $moduleObj->getFullName() . ':' . $name;
76
+            return $moduleObj->getFullName().':'.$name;
77 77
         }
78 78
         return $name;
79 79
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         }
96 96
         $prefixGroup = $this->getRouteGroupPrefix($group);
97 97
         if ($module !== null && ($moduleObj = $this->find($module))) {
98
-            return $moduleObj->getFullName() . $prefixGroup . ':' . $name;
98
+            return $moduleObj->getFullName().$prefixGroup.':'.$name;
99 99
         }
100 100
         return $name;
101 101
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function getUriBase(Request $request, bool $beautify = true): string
138 138
     {
139 139
         $index = $beautify ? $this->getUrlIndex($request) : $request->getIndex();
140
-        return $request->getUriBase() . $index;
140
+        return $request->getUriBase().$index;
141 141
     }
142 142
 
143 143
     /**
@@ -148,6 +148,6 @@  discard block
 block discarded – undo
148 148
      */
149 149
     protected function getRouteGroupPrefix(?string $group): string
150 150
     {
151
-        return $group === null || $group === 'default' ? '' : '@' . $group;
151
+        return $group === null || $group === 'default' ? '' : '@'.$group;
152 152
     }
153 153
 }
Please login to merge, or discard this patch.
suda/src/application/ModuleBag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @param string $path
80 80
      * @return Module|null
81 81
      */
82
-    public function guess(string $path):?Module
82
+    public function guess(string $path): ?Module
83 83
     {
84 84
         foreach ($this->module as $module) {
85 85
             if (FileSystem::isOverflowPath($module->getPath(), $path) === false) {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      * @param string $name
113 113
      * @return Module|null
114 114
      */
115
-    public function get(string $name):?Module
115
+    public function get(string $name): ?Module
116 116
     {
117 117
         $full = $this->getFullName($name);
118 118
         return  $this->module[$full] ?? null;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         if (array_key_exists($version, $this->knownsFullName[$sortName])) {
206 206
             return $this->knownsFullName[$sortName][$version];
207 207
         }
208
-        return $hasVersion?$sortName.':'.$version:end($this->knownsFullName[$sortName]);
208
+        return $hasVersion ? $sortName.':'.$version : end($this->knownsFullName[$sortName]);
209 209
     }
210 210
 
211 211
     protected function getLikeName(string $name):string
Please login to merge, or discard this patch.
suda/src/framework/route/uri/parameter/StringParameter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function packValue(?string $matched)
33 33
     {
34
-        return $matched ? urlencode($matched): '';
34
+        return $matched ? urlencode($matched) : '';
35 35
     }
36 36
     
37 37
     /**
Please login to merge, or discard this patch.
suda/src/framework/Route.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
         $this->routes = new RouteCollection;
45 45
         $this->runnable = [];
46
-        $this->default = new Runnable([__CLASS__ , 'defaultResponse']);
46
+        $this->default = new Runnable([__CLASS__, 'defaultResponse']);
47 47
     }
48 48
 
49 49
     /**
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      * @param bool $allowQuery
301 301
      * @return string|null
302 302
      */
303
-    public function create(string $name, array $parameter, bool $allowQuery = true):?string
303
+    public function create(string $name, array $parameter, bool $allowQuery = true): ?string
304 304
     {
305 305
         if ($matcher = $this->routes->get($name)) {
306 306
             return UriMatcher::buildUri($matcher->getMatcher(), $parameter, $allowQuery);
Please login to merge, or discard this patch.
suda/src/framework/debug/log/logger/ConsoleLogger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function log($level, $message, array $context = [])
19 19
     {
20
-        print date('Y-m-d H:i:s') . ' ' . $this->interpolate($message, $context) . PHP_EOL;
20
+        print date('Y-m-d H:i:s').' '.$this->interpolate($message, $context).PHP_EOL;
21 21
     }
22 22
 
23 23
     /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $replace = [];
31 31
         foreach ($context as $key => $val) {
32
-            $replace['{' . $key . '}'] = $val;
32
+            $replace['{'.$key.'}'] = $val;
33 33
         }
34 34
         return strtr($message, $replace);
35 35
     }
Please login to merge, or discard this patch.
server.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,17 +2,17 @@
 block discarded – undo
2 2
 $host = $argv[1] ?? '127.0.0.1:9501';
3 3
 list($ip, $port) = explode(':', $host);
4 4
 
5
-define('SUDA_APP', __DIR__ . '/app');
6
-define('SUDA_DATA', __DIR__ . '/data');
7
-define('SUDA_SYSTEM', __DIR__ . '/suda');
5
+define('SUDA_APP', __DIR__.'/app');
6
+define('SUDA_DATA', __DIR__.'/data');
7
+define('SUDA_SYSTEM', __DIR__.'/suda');
8 8
 define('SUDA_PUBLIC', __DIR__);
9 9
 define('SUDA_DEBUG', true);
10 10
 define('SUDA_DEBUG_LEVEL', 'debug');
11
-define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest');
11
+define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest');
12 12
 
13 13
 // 设置IP或者端口
14 14
 define('SUDA_SWOOLE_IP', $ip);
15 15
 define('SUDA_SWOOLE_PORT', $port);
16 16
 
17
-require_once __DIR__ .'/vendor/autoload.php';
17
+require_once __DIR__.'/vendor/autoload.php';
18 18
 require_once SUDA_SYSTEM.'/loader/swoole.php';
19 19
\ No newline at end of file
Please login to merge, or discard this patch.
public/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 define('SUDA_DEBUG', true);
7 7
 define('SUDA_DEBUG_LEVEL', 'info');
8 8
 
9
-require_once __DIR__ .'/../vendor/autoload.php';
9
+require_once __DIR__.'/../vendor/autoload.php';
10 10
 require_once SUDA_SYSTEM.'/loader/main.php';
11 11
 
12 12
 
Please login to merge, or discard this patch.
suda/src/application/template/ModuleTemplate.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $subfix = $this->config['subfix'] ?? '.tpl.html';
22 22
         $path = $this
23 23
             ->getResource($this->module)
24
-            ->getResourcePath($this->getTemplatePath() . '/' . $this->name . $subfix);
24
+            ->getResourcePath($this->getTemplatePath().'/'.$this->name.$subfix);
25 25
         $this->loadDynamicTemplateConfig($path.'.ini');
26 26
         return $path;
27 27
     }
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function getPath()
48 48
     {
49
-        $output = $this->config['output'] ?? $this->application->getDataPath() . '/template/' . $this->uriName;
49
+        $output = $this->config['output'] ?? $this->application->getDataPath().'/template/'.$this->uriName;
50 50
         FileSystem::make($output);
51
-        return $output . '/' . $this->name . '.php';
51
+        return $output.'/'.$this->name.'.php';
52 52
     }
53 53
 
54 54
     /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function getRenderedString()
74 74
     {
75
-        $this->application->debug()->time('render ' . $this->name);
75
+        $this->application->debug()->time('render '.$this->name);
76 76
         $code = parent::getRenderedString();
77
-        $time = $this->application->debug()->timeEnd('render ' . $this->name);
77
+        $time = $this->application->debug()->timeEnd('render '.$this->name);
78 78
         $this->application->debug()->recordTiming('render', $time);
79 79
         return $code;
80 80
     }
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
     protected function compile()
87 87
     {
88 88
         if ($this->isCompiled() === false) {
89
-            $this->application->debug()->time('compile ' . $this->name);
89
+            $this->application->debug()->time('compile '.$this->name);
90 90
             $result = parent::compile();
91
-            $this->application->debug()->timeEnd('compile ' . $this->name);
91
+            $this->application->debug()->timeEnd('compile '.$this->name);
92 92
             return $result;
93 93
         }
94 94
         return true;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             }
113 113
             return $this->application->getUrl($this->request, $name, $values ?? [], true, $this->module, $this->group);
114 114
         } elseif (is_string($defaultName)) {
115
-            $parameter = is_array($name)?array_merge($query, $name):$query;
115
+            $parameter = is_array($name) ?array_merge($query, $name) : $query;
116 116
             return $this->application->getUrl(
117 117
                 $this->request,
118 118
                 $defaultName,
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 $this->group
123 123
             );
124 124
         }
125
-        return '#' . $defaultName;
125
+        return '#'.$defaultName;
126 126
     }
127 127
 
128 128
 
Please login to merge, or discard this patch.
suda/src/framework/debug/Debug.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
         $replace = [];
71 71
         $attach = [];
72 72
         foreach ($context as $key => $val) {
73
-            $replaceKey = '{' . $key . '}';
73
+            $replaceKey = '{'.$key.'}';
74 74
             if ($this->canBeStringValue($val) && strpos($message, $replaceKey) !== false) {
75
-                $replace['{' . $key . '}'] = $val;
75
+                $replace['{'.$key.'}'] = $val;
76 76
             } else {
77 77
                 $attach[$key] = $val;
78 78
             }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
139 139
         $pos = min($pow, count($human) - 1);
140 140
         $bytes /= (1 << (10 * $pos));
141
-        return round($bytes, $precision) . ' ' . $human[$pos];
141
+        return round($bytes, $precision).' '.$human[$pos];
142 142
     }
143 143
 
144 144
     /**
Please login to merge, or discard this patch.