Completed
Push — 6.0 ( 5e6ce8...b2fd60 )
by liu
06:34
created
src/think/view/driver/Php.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\view\driver;
14 14
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         // 模板不存在 抛出异常
80 80
         if (!is_file($template)) {
81
-            throw new RuntimeException('template not exists:' . $template);
81
+            throw new RuntimeException('template not exists:'.$template);
82 82
         }
83 83
 
84 84
         $this->template = $template;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $this->content = $content;
101 101
 
102 102
         extract($data, EXTR_OVERWRITE);
103
-        eval('?>' . $this->content);
103
+        eval('?>'.$this->content);
104 104
     }
105 105
 
106 106
     /**
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
             $appName = isset($app) ? $app : $this->app->http->getName();
126 126
             $view    = $this->config['view_dir_name'];
127 127
 
128
-            if (is_dir($this->app->getAppPath() . $view)) {
129
-                $path = isset($app) ? $this->app->getBasePath() . ($appName ? $appName . DIRECTORY_SEPARATOR : '') . $view . DIRECTORY_SEPARATOR : $this->app->getAppPath() . $view . DIRECTORY_SEPARATOR;
128
+            if (is_dir($this->app->getAppPath().$view)) {
129
+                $path = isset($app) ? $this->app->getBasePath().($appName ? $appName.DIRECTORY_SEPARATOR : '').$view.DIRECTORY_SEPARATOR : $this->app->getAppPath().$view.DIRECTORY_SEPARATOR;
130 130
             } else {
131
-                $path = $this->app->getRootPath() . $view . DIRECTORY_SEPARATOR . ($appName ? $appName . DIRECTORY_SEPARATOR : '');
131
+                $path = $this->app->getRootPath().$view.DIRECTORY_SEPARATOR.($appName ? $appName.DIRECTORY_SEPARATOR : '');
132 132
             }
133 133
         }
134 134
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $controller = $request->controller();
140 140
             if (strpos($controller, '.')) {
141 141
                 $pos        = strrpos($controller, '.');
142
-                $controller = substr($controller, 0, $pos) . '.' . Str::snake(substr($controller, $pos + 1));
142
+                $controller = substr($controller, 0, $pos).'.'.Str::snake(substr($controller, $pos + 1));
143 143
             } else {
144 144
                 $controller = Str::snake($controller);
145 145
             }
@@ -155,16 +155,16 @@  discard block
 block discarded – undo
155 155
                         $template = Str::snake($request->action());
156 156
                     }
157 157
 
158
-                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template;
158
+                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template;
159 159
                 } elseif (false === strpos($template, $depr)) {
160
-                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template;
160
+                    $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template;
161 161
                 }
162 162
             }
163 163
         } else {
164 164
             $template = str_replace(['/', ':'], $depr, substr($template, 1));
165 165
         }
166 166
 
167
-        return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.');
167
+        return $path.ltrim($template, '/').'.'.ltrim($this->config['view_suffix'], '.');
168 168
     }
169 169
 
170 170
     /**
Please login to merge, or discard this patch.