Passed
Branch dev (c500dd)
by 世昌
03:56
created
suda/src/application/database/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
      */
69 69
     public static function getDataSourceFrom(ApplicationResource $resource, string $groupName)
70 70
     {
71
-        $group = $groupName === 'default' ? '': '-'. $groupName;
71
+        $group = $groupName === 'default' ? '' : '-'.$groupName;
72 72
         $dataSourceConfigPath = $resource->getConfigResourcePath('config/data-source'.$group);
73 73
         $dataSource = new DataSource;
74 74
         $observer = new DebugObserver(static::$application->debug());
Please login to merge, or discard this patch.
suda/src/application/Application.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function prepare(Request $request, Response $response)
66 66
     {
67
-        $response->setHeader('x-powered-by', 'suda/' . SUDA_VERSION, true);
67
+        $response->setHeader('x-powered-by', 'suda/'.SUDA_VERSION, true);
68 68
         $response->getWrapper()->register(ExceptionContentWrapper::class, [Throwable::class]);
69 69
         $response->getWrapper()->register(TemplateWrapper::class, [RawTemplate::class]);
70 70
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             if (!$response->isSend()) {
107 107
                 $response->end();
108 108
             }
109
-            $this->debug->info('responded with code ' . $response->getStatus());
109
+            $this->debug->info('responded with code '.$response->getStatus());
110 110
             $this->debug->timeEnd('sending response');
111 111
         } catch (Throwable $e) {
112 112
             $this->debug->uncaughtException($e);
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
         $route = $attributes['config'] ?? [];
132 132
         $runnable = null;
133 133
         if (array_key_exists('class', $route)) {
134
-            $runnable = $this->className($route['class']) . '->onRequest';
134
+            $runnable = $this->className($route['class']).'->onRequest';
135 135
         } elseif (array_key_exists('source', $route)) {
136 136
             $attributes['source'] = $route['source'];
137
-            $runnable = FileRequestProcessor::class . '->onRequest';
137
+            $runnable = FileRequestProcessor::class.'->onRequest';
138 138
         } elseif (array_key_exists('template', $route)) {
139 139
             $attributes['template'] = $route['template'];
140
-            $runnable = TemplateRequestProcessor::class . '->onRequest';
140
+            $runnable = TemplateRequestProcessor::class.'->onRequest';
141 141
         } elseif (array_key_exists('runnable', $route)) {
142 142
             $runnable = $route['runnable'];
143 143
         } else {
Please login to merge, or discard this patch.
suda/src/application/loader/ApplicationLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         foreach ($this->application->getModules() as $name => $module) {
56 56
             if ($module->getStatus() === Module::REACHABLE) {
57
-                call_user_func([$this->moduleLoader[$name],'toReachable']);
57
+                call_user_func([$this->moduleLoader[$name], 'toReachable']);
58 58
             }
59 59
         }
60 60
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
     protected function registerModule()
113 113
     {
114
-        $extractPath = SUDA_DATA .'/extract-module';
114
+        $extractPath = SUDA_DATA.'/extract-module';
115 115
         FileSystem::make($extractPath);
116 116
         foreach ($this->application->getModulePaths() as $path) {
117 117
             $this->registerModuleFrom($path, $extractPath);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         }
138 138
         $config = $config ?? [];
139 139
         $moduleNames = array_keys($modules->all());
140
-        $load  = $config['load'] ?? $moduleNames;
140
+        $load = $config['load'] ?? $moduleNames;
141 141
         $this->loadModules($modules, $load);
142 142
         $active = $config['active'] ?? $load;
143 143
         $this->setModuleActive($modules, $active);
Please login to merge, or discard this patch.
suda/src/database/struct/ReadStatement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function one(?string $class = null, array $args = [])
36 36
     {
37
-        return $this->access->run($this->limit(0,1)->wantOne($class, $args));
37
+        return $this->access->run($this->limit(0, 1)->wantOne($class, $args));
38 38
     }
39 39
 
40 40
     /**
Please login to merge, or discard this patch.
suda/src/framework/debug/attach/AttachTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
     protected function analyse(string $message, array $context)
24 24
     {
25 25
         $replace = [];
26
-        $attach = [] ;
26
+        $attach = [];
27 27
         foreach ($context as $key => $val) {
28
-            $replaceKey = '{' . $key . '}';
28
+            $replaceKey = '{'.$key.'}';
29 29
             if ($this->isReplacedObj($val) && strpos($message, $replaceKey) !== false) {
30
-                $replace['{' . $key . '}'] = $val;
30
+                $replace['{'.$key.'}'] = $val;
31 31
             } else {
32 32
                 $attach[$key] = $val;
33 33
             }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     protected function isReplacedObj($val) : bool
39 39
     {
40
-        return !is_array($val) && (!is_object($val) || method_exists($val, '__toString')) && (! $val instanceof Throwable);
40
+        return !is_array($val) && (!is_object($val) || method_exists($val, '__toString')) && (!$val instanceof Throwable);
41 41
     }
42 42
 
43 43
     public function interpolate(string $message, array $context, array $attribute)
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         list($attach, $replace) = $this->analyse($message, $context);
46 46
         $attribute = array_merge($this->attribute, $attribute);
47 47
         foreach ($attribute as $key => $val) {
48
-            $replace['%' . $key . '%'] = $val;
48
+            $replace['%'.$key.'%'] = $val;
49 49
         }
50 50
         $message = strtr($message, $replace);
51 51
         $attachInfo = '';
Please login to merge, or discard this patch.
suda/src/framework/debug/Debug.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $replace = [];
69 69
         foreach ($context as $key => $val) {
70 70
             if ($this->canBeStringValue($val)) {
71
-                $replace['{' . $key . '}'] = $val;
71
+                $replace['{'.$key.'}'] = $val;
72 72
             }
73 73
         }
74 74
         return strtr($message, $replace);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
98 98
         $pos = min($pow, count($human) - 1);
99 99
         $bytes /= (1 << (10 * $pos));
100
-        return round($bytes, $precision) . ' ' . $human[$pos];
100
+        return round($bytes, $precision).' '.$human[$pos];
101 101
     }
102 102
 
103 103
     public function time(string $name, string $type = LogLevel::INFO)
Please login to merge, or discard this patch.
suda/src/framework/exception/JsonException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  */
10 10
 class JsonException extends RuntimeException
11 11
 {
12
-    public static $error=[
12
+    public static $error = [
13 13
         JSON_ERROR_NONE=>'no errors',
14 14
         JSON_ERROR_DEPTH=>'maximum stack depth exceeded',
15 15
         JSON_ERROR_STATE_MISMATCH=>'underflow or the modes mismatch',
Please login to merge, or discard this patch.
suda/src/framework/config/ContentLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
     protected static function parseValue(string $content, array $extra = []): string
61 61
     {
62
-        return preg_replace_callback('/\$\{(.+?)\}/', function ($matchs) use ($extra) {
62
+        return preg_replace_callback('/\$\{(.+?)\}/', function($matchs) use ($extra) {
63 63
             $name = $matchs[1];
64 64
             if (($value = ArrayDotAccess::get($extra, $name, null)) !== null) {
65 65
             } elseif (defined($name)) {
Please login to merge, or discard this patch.
suda/src/framework/loader/PathTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public static function formatSeparator(string $path, string $separator = DIRECTORY_SEPARATOR):string
16 16
     {
17
-        return str_replace(['\\','/'], $separator, $path);
17
+        return str_replace(['\\', '/'], $separator, $path);
18 18
     }
19 19
 
20 20
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     {
85 85
         if (static::getHomePath() !== null && strpos($path, '~') === 0) {
86 86
             $scheme = '';
87
-            $subpath = static::getHomePath() .DIRECTORY_SEPARATOR.substr($path, 1);
87
+            $subpath = static::getHomePath().DIRECTORY_SEPARATOR.substr($path, 1);
88 88
         } elseif (strpos($path, '://') !== false) {
89 89
             list($scheme, $subpath) = explode('://', $path, 2);
90 90
             $scheme .= '://';
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     /**
100 100
      * @return string|null
101 101
      */
102
-    public static function getHomePath():?string
102
+    public static function getHomePath(): ?string
103 103
     {
104 104
         if (defined('USER_HOME_PATH')) {
105 105
             return constant('USER_HOME_PATH');
Please login to merge, or discard this patch.