Passed
Push — master ( 9d5835...e8364e )
by 世昌
02:16
created
suda/src/framework/session/PHPSession.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         if (is_string($id = $request->getCookie($name))) {
67 67
             session_id($id);
68
-        }else{
68
+        } else {
69 69
             $id = md5($path.$request->getRemoteAddr().uniqid());
70 70
             session_id($id);
71 71
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     public function get(string $name = null, $default = null)
101 101
     {
102 102
         if ($name !== null) {
103
-            return $this->has($name) ?$_SESSION[$name]:$default;
103
+            return $this->has($name) ? $_SESSION[$name] : $default;
104 104
         } else {
105 105
             return $_SESSION;
106 106
         }
Please login to merge, or discard this patch.
suda/src/framework/response/wrapper/FileContentWrapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         $content = $this->content;
24 24
         $response->setType($content->getExtension());
25
-        $response->setHeader('Content-Disposition', 'attachment;filename="' . $content->getBasename().'"');
25
+        $response->setHeader('Content-Disposition', 'attachment;filename="'.$content->getBasename().'"');
26 26
         $response->setHeader('Cache-Control', 'max-age=0');
27 27
         return new DataStream($content);
28 28
     }
Please login to merge, or discard this patch.
suda/src/application/template/compiler/Tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $this->content = $content;
40 40
         $this->name = $name;
41 41
         $this->open = $open;
42
-        $this->close= $close;
42
+        $this->close = $close;
43 43
     }
44 44
 
45 45
     public function compile(string $content):string
Please login to merge, or discard this patch.
suda/src/application/template/ModuleTemplateCompiler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
     protected $tag = [
21 21
         'raw' => ['{{!', '}}', '<?php echo $code; ?>'],
22 22
         'comment' => ['{--', '--}', '<?php /* $code */ ?>'],
23
-        'echo' => [ '{{', '}}', '<?php echo htmlspecialchars($this->application->_($code), ENT_SUBSTITUTE | ENT_QUOTES | ENT_HTML5); ?>' ],
23
+        'echo' => ['{{', '}}', '<?php echo htmlspecialchars($this->application->_($code), ENT_SUBSTITUTE | ENT_QUOTES | ENT_HTML5); ?>'],
24 24
         'string' => ['{=', '}', '<?php echo htmlspecialchars($this->application->_("$code"), ENT_SUBSTITUTE | ENT_QUOTES | ENT_HTML5); ?>'],
25
-        'raw-string' => ['@{', '}', '<?php echo htmlspecialchars($code, ENT_SUBSTITUTE | ENT_QUOTES | ENT_HTML5); ?>' ],
26
-        'event' => ['{:', '}', '<?php $this->application->event()->exec("$code", [$this]); ?>' ],
25
+        'raw-string' => ['@{', '}', '<?php echo htmlspecialchars($code, ENT_SUBSTITUTE | ENT_QUOTES | ENT_HTML5); ?>'],
26
+        'event' => ['{:', '}', '<?php $this->application->event()->exec("$code", [$this]); ?>'],
27 27
     ];
28 28
 
29 29
     public function __construct()
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
      * 包含本地化语言数组
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public static function format(string $string, array $param)
51 51
     {
52
-        return preg_replace_callback('/(?<!\$)\$(\{)?(\d+|\w+?\b)(?(1)\})/', function ($match) use ($param) {
52
+        return preg_replace_callback('/(?<!\$)\$(\{)?(\d+|\w+?\b)(?(1)\})/', function($match) use ($param) {
53 53
             $key = $match[2];
54 54
             if (array_key_exists($key, $param)) {
55 55
                 return strval($param[$key]);
Please login to merge, or discard this patch.
suda/src/application/template/compiler/Command.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
     
121 121
     protected function parseStatic($content)
122 122
     {
123
-        $content = strlen(trim($content)) === 0 ?'()':$content;
123
+        $content = strlen(trim($content)) === 0 ? '()' : $content;
124 124
         return '<?php echo $this->getStaticPrefix'.$content.'; ?>';
125 125
     }
126 126
 
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
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $this->routes = new RouteCollection;
44 44
         $this->runnable = [];
45
-        $this->default = new Runnable([__CLASS__ , 'defaultResponse']);
45
+        $this->default = new Runnable([__CLASS__, 'defaultResponse']);
46 46
     }
47 47
 
48 48
     /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @param boolean $allowQuery
290 290
      * @return string|null
291 291
      */
292
-    public function create(string $name, array $parameter, bool $allowQuery = true):?string
292
+    public function create(string $name, array $parameter, bool $allowQuery = true): ?string
293 293
     {
294 294
         if ($matcher = $this->routes->get($name)) {
295 295
             return UriMatcher::buildUri($matcher->getMatcher(), $parameter, $allowQuery);
Please login to merge, or discard this patch.
suda/src/application/loader/ApplicationLoader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function getDataSourceGroup(string $groupName):DataSource
86 86
     {
87
-        $group = $groupName === 'default' ? '': '-'. $groupName;
87
+        $group = $groupName === 'default' ? '' : '-'.$groupName;
88 88
         $dataSourceConfigPath = $this->application->getResource()->getConfigResourcePath('config/data-source'.$group);
89 89
         $dataSource = new DataSource;
90 90
         $observer = new DebugObserver($this->application->debug());
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     protected function registerModule()
123 123
     {
124
-        $extractPath = SUDA_DATA .'/extract-module';
124
+        $extractPath = SUDA_DATA.'/extract-module';
125 125
         FileSystem::make($extractPath);
126 126
         foreach ($this->application->getModulePaths() as  $path) {
127 127
             $this->registerModuleFrom($path, $extractPath);
Please login to merge, or discard this patch.
suda/src/application/template/ModuleTemplateCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
     
16 16
     protected function parseStatic($content)
17 17
     {
18
-        $content = strlen(trim($content)) === 0 ?'()':$content;
18
+        $content = strlen(trim($content)) === 0 ? '()' : $content;
19 19
         return '<?php echo $this->getStaticModulePrefix'.$content.'; ?>';
20 20
     }
21 21
 
22 22
     protected function parseFile($content)
23 23
     {
24
-        $content = strlen(trim($content)) === 0 ?'()':$content;
24
+        $content = strlen(trim($content)) === 0 ? '()' : $content;
25 25
         return '<?php echo $this->getModulePrefix'.$content.'; ?>';
26 26
     }
27 27
 }
Please login to merge, or discard this patch.