Passed
Push — master ( 2b844c...ae9c2c )
by 世昌
01:42
created
nebula/src/application/module/Manager.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@
 block discarded – undo
148 148
             $this->module[$module->getFullName()] = $module;
149 149
             $this->getContext()->getDebugger()->info('register module {name} at {path}', ['name'=>$module->getFullName(), 'path'=>$module->getPath()]);
150 150
         }
151
-       $this->buildLoadingOrder('alive', 'loadingOrder');
152
-       $this->buildLoadingOrder('reachable', 'routeLoadingOrder');
151
+        $this->buildLoadingOrder('alive', 'loadingOrder');
152
+        $this->buildLoadingOrder('reachable', 'routeLoadingOrder');
153 153
     }
154 154
     
155 155
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function registerModule()
141 141
     {
142 142
         $scan = $this->getContext()->getConfig()->get('app.module.scan-path', []);
143
-        $cache = $this->getContext()->getApplication()->getDataPath() .'/module-cache';
143
+        $cache = $this->getContext()->getApplication()->getDataPath().'/module-cache';
144 144
         FileSystem::makes($cache);
145 145
         // 扫描加载
146 146
         foreach (Builder::scan($scan, $cache) as $module) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      * @param string $name
191 191
      * @return Module|null
192 192
      */
193
-    public function find(string $name):?Module
193
+    public function find(string $name): ?Module
194 194
     {
195 195
         $fullName = $this->finder->getFullName($name);
196 196
         return $this->module[$fullName] ?? null;
Please login to merge, or discard this patch.
nebula/src/application/Route.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     public function loadFromModule(Manager $manager) {
50 50
         $groups =  $this->applicaton->getConfig()->get('app.active',['default']);
51 51
         foreach ($groups as $group) {
52
-           $manager->loadRoute($group, $this);
52
+            $manager->loadRoute($group, $this);
53 53
         }
54 54
     }
55 55
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @return void
48 48
      */
49 49
     public function loadFromModule(Manager $manager) {
50
-        $groups =  $this->applicaton->getConfig()->get('app.active',['default']);
50
+        $groups = $this->applicaton->getConfig()->get('app.active', ['default']);
51 51
         foreach ($groups as $group) {
52 52
            $manager->loadRoute($group, $this);
53 53
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function addGroupRoute(string $group, GroupRoutes $route) {
64 64
         if (\array_key_exists($group, $this->routes)) {
65 65
             $this->routes[$group]->merge($route);
66
-        }else{
66
+        } else {
67 67
             $this->routes[$group] = $route;
68 68
         }
69 69
     } 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public function addGroupRoute(string $group, GroupRoutes $route) {
64 64
         if (\array_key_exists($group, $this->routes)) {
65 65
             $this->routes[$group]->merge($route);
66
-        }else{
66
+        } else{
67 67
             $this->routes[$group] = $route;
68 68
         }
69 69
     } 
Please login to merge, or discard this patch.
nebula/loader/web.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,15 +4,15 @@
 block discarded – undo
4 4
 use nebula\application\Loader;
5 5
 use nebula\component\request\Request;
6 6
 
7
-require_once __DIR__ .'/loader.php';
7
+require_once __DIR__.'/loader.php';
8 8
 
9 9
 
10 10
 
11 11
 // 初始化系统加载器
12 12
 $loader = new Loader;
13 13
 $loader->register();
14
-$loader->addIncludePath(NEBULA_SYSTEM .'/src', 'nebula');
15
-$loader->import(NEBULA_SYSTEM .'/src/functions.php');
14
+$loader->addIncludePath(NEBULA_SYSTEM.'/src', 'nebula');
15
+$loader->import(NEBULA_SYSTEM.'/src/functions.php');
16 16
 // 初始化请求
17 17
 $request = Request::buildFromServer();
18 18
 $request->apply(true);
Please login to merge, or discard this patch.
nebula/src/NebulaApplication.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
         }
96 96
         if (!$this->config->has('app.import')) {
97 97
             $this->config->set('app.import', [
98
-                0 => \constant('NEBULA_APP').'/' .'share',
98
+                0 => \constant('NEBULA_APP').'/'.'share',
99 99
             ]);
100 100
         }
101 101
         if (!$this->config->has('app.resource')) {
102 102
             $this->config->set('app.resource', [
103
-                0 => \constant('NEBULA_APP').'/' .'resource',
103
+                0 => \constant('NEBULA_APP').'/'.'resource',
104 104
             ]);
105 105
         }
106 106
         if (!$this->config->has('app.module.scan-path')) {
107 107
             $this->config->set('app.module.scan-path', [
108
-                0 => \constant('NEBULA_APP').'/' .'modules',
108
+                0 => \constant('NEBULA_APP').'/'.'modules',
109 109
             ]);
110 110
         }
111
-        $timezone = defined('DEFAULT_TIMEZONE')?constant('DEFAULT_TIMEZONE'):'PRC';
111
+        $timezone = defined('DEFAULT_TIMEZONE') ?constant('DEFAULT_TIMEZONE') : 'PRC';
112 112
         date_default_timezone_set($this->config->get('app.timezone', $timezone));
113 113
     }
114 114
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
         $logger = (new Runnable($this->getConfig()->get('app.logger-build', [$this, 'buildLogger'])))->run();
124 124
         $debugger = new Debugger;
125 125
         
126
-        $debugger->addAttribute('remote-ip' , $this->getRequest()->ip() );
127
-        $debugger->addAttribute('request-uri' , $this->getRequest()->getUrl());
128
-        $debugger->addAttribute('request-method' , $this->getRequest()->getMethod());
129
-        $debugger->addAttribute('request-time' , date('Y-m-d H:i:s', \constant('NEBULA_START_TIME')));
126
+        $debugger->addAttribute('remote-ip', $this->getRequest()->ip());
127
+        $debugger->addAttribute('request-uri', $this->getRequest()->getUrl());
128
+        $debugger->addAttribute('request-method', $this->getRequest()->getMethod());
129
+        $debugger->addAttribute('request-time', date('Y-m-d H:i:s', \constant('NEBULA_START_TIME')));
130 130
 
131 131
         $debugger->applyConfig([
132 132
             'start-time' => \constant('NEBULA_START_TIME'),
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function run()
194 194
     {
195
-        $className  = $this->config->get('app.application', Application::class);
195
+        $className = $this->config->get('app.application', Application::class);
196 196
         $this->application = Runnable::newClassInstance($className);
197 197
         $this->application->setContext($this);
198 198
         $this->application->setPath($this->path);
Please login to merge, or discard this patch.
nebula/src/application/module/Module.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function getRoute(string $groupName): GroupRoutes
86 86
     {
87
-        $group = $groupName === 'default' ? '': '-'. $groupName;
88
-        $routeConfig = $this->getConfigFrom('route'.$group, ['group' => $group,]);
89
-        $routes =  new GroupRoutes($groupName);
87
+        $group = $groupName === 'default' ? '' : '-'.$groupName;
88
+        $routeConfig = $this->getConfigFrom('route'.$group, ['group' => $group, ]);
89
+        $routes = new GroupRoutes($groupName);
90 90
         if (\is_array($routeConfig)) {
91 91
             // debug()->debug('load route {group} from {module}',['group'=>$groupName, 'module' => $this->getFullName()]);
92 92
             $prefix = $this->config->get('route.prefix', '');
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function getFullName()
143 143
     {
144
-        return $this->name .':'. $this->version;
144
+        return $this->name.':'.$this->version;
145 145
     }
146 146
 
147 147
     /**
Please login to merge, or discard this patch.