Passed
Push — master ( 185757...a51c77 )
by 世昌
02:03
created
nebula/src/application/response/Response.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@
 block discarded – undo
103 103
      */
104 104
     public function setStatus(int $code)
105 105
     {
106
-        $this->header->sendHeaderRaw('HTTP/1.1 '.$code.' '. Status::toText($code));
107
-        $this->header->sendHeader('Status', $code.' '. Status::toText($code));
106
+        $this->header->sendHeaderRaw('HTTP/1.1 '.$code.' '.Status::toText($code));
107
+        $this->header->sendHeader('Status', $code.' '.Status::toText($code));
108 108
     }
109 109
 
110 110
     /**
Please login to merge, or discard this patch.
nebula/src/application/response/provider/Content.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 class Content
14 14
 {
15 15
     protected $types = [
16
-        JsonContent::class => ['boolean','bool','integer','int','float','string','array','null', JsonSerializable::class ],
16
+        JsonContent::class => ['boolean', 'bool', 'integer', 'int', 'float', 'string', 'array', 'null', JsonSerializable::class],
17 17
         FileContent::class => [SplFileInfo::class],
18 18
     ];
19 19
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
                 }
32 32
             }
33 33
         }
34
-        if (\method_exists($content,'__toString')) {
34
+        if (\method_exists($content, '__toString')) {
35 35
             return Response::instance()->send($content->__toString());
36 36
         }
37 37
         throw new \Exception(sprintf('can not encode %s class to response', get_class($content)));
Please login to merge, or discard this patch.
nebula/src/NebulaApplication.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     private function initBaseConfig()
91 91
     {
92
-        $this->initConfigIfNotSet('app.route.active', defined('NEBULA_ROUTE_GROUPS')? \explode(',', \constant('NEBULA_ROUTE_GROUPS')) :['default']);
92
+        $this->initConfigIfNotSet('app.route.active', defined('NEBULA_ROUTE_GROUPS') ? \explode(',', \constant('NEBULA_ROUTE_GROUPS')) : ['default']);
93 93
         $this->initConfigIfNotSet('app.import', [\constant('NEBULA_APP').'/'.'share']);
94 94
         $this->initConfigIfNotSet('app.resource', [\constant('NEBULA_APP').'/'.'resource']);
95 95
         $this->initConfigIfNotSet('app.module.scan-path', [\constant('NEBULA_APP').'/'.'modules']);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     private function initTimezone()
118 118
     {
119
-        $timezone = defined('DEFAULT_TIMEZONE')?constant('DEFAULT_TIMEZONE'):'PRC';
119
+        $timezone = defined('DEFAULT_TIMEZONE') ?constant('DEFAULT_TIMEZONE') : 'PRC';
120 120
         date_default_timezone_set($this->config->get('app.timezone', $timezone));
121 121
     }
122 122
 
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function run()
202 202
     {
203
-        $className  = $this->config->get('app.application', Application::class);
203
+        $className = $this->config->get('app.application', Application::class);
204 204
         $this->application = Runnable::newClassInstance($className);
205 205
         $this->application->setContext($this);
206 206
         $this->application->setPath($this->path);
207 207
         $this->application->setDataPath($this->dataPath);
208 208
         $this->application->initialization();
209 209
         Response::instance()->setContext($this);
210
-        Response::instance()->proccess(new Runnable(function(Request $request, Response $response){
210
+        Response::instance()->proccess(new Runnable(function(Request $request, Response $response) {
211 211
             $response->setStatus(403);
212 212
             return ['hello', 'world'];
213 213
         }), $this->getRequest());
Please login to merge, or discard this patch.