Completed
Pull Request — master (#1936)
by
unknown
01:56
created
core/helpers/ObjectHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         }
49 49
         
50 50
         if ($throwException) {
51
-            throw new Exception("The given object must be an instance of: " . implode(",", $haystack));
51
+            throw new Exception("The given object must be an instance of: ".implode(",", $haystack));
52 52
         }
53 53
         
54 54
         return false;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             
219 219
         };
220 220
 
221
-        $staticPath = $module::staticBasePath() . DIRECTORY_SEPARATOR . 'controllers';
221
+        $staticPath = $module::staticBasePath().DIRECTORY_SEPARATOR.'controllers';
222 222
         if (is_dir($staticPath)) {
223 223
             foreach (FileHelper::findFiles($staticPath) as $file) {
224 224
                 $files[self::fileToName($staticPath, $file)] = $file;
Please login to merge, or discard this patch.
core/base/Module.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         $this->theme = Yii::$app->themeManager->getActiveTheme();
218 218
 
219
-        if ($this->theme){
219
+        if ($this->theme) {
220 220
             $this->layout = $this->theme->layout;
221 221
     
222 222
             if ($this->useAppLayoutPath) {
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      */
330 330
     public function getControllerPath()
331 331
     {
332
-        return Yii::getAlias('@' . str_replace('\\', '/', $this->controllerNamespace), false);
332
+        return Yii::getAlias('@'.str_replace('\\', '/', $this->controllerNamespace), false);
333 333
     }
334 334
 
335 335
     // STATIC METHODS
Please login to merge, or discard this patch.
core/console/commands/ThemeController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $themeConfig->parentTheme = $this->prompt("Enter the base path (e.g. `@app/themes/blank`) of the parent theme:",
39 39
                 [
40 40
                     'default' => '@app/themes/blank',
41
-                    'validator' => function ($input, &$error) {
41
+                    'validator' => function($input, &$error) {
42 42
                         if (preg_match('/^[a-z]+$/', $input) === false) {
43 43
                             $error = 'The theme name must be only letter chars!';
44 44
                             return false;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     
78 78
         $availableModules = implode(', ', array_column(Yii::$app->getFrontendModules(), 'id'));
79 79
         $themeLocation = $this->prompt("Enter the theme location where to generate (as path alias e.g. app, $availableModules):", ['default' => 'app']);
80
-        $themeLocation = '@' . ltrim($themeLocation, '@');
80
+        $themeLocation = '@'.ltrim($themeLocation, '@');
81 81
     
82 82
         preg_match("#^@[A-z]+#", $themeLocation, $newThemeLocation);
83 83
         if ($newThemeLocation[0] !== $themeLocation) {
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
             }
89 89
         }
90 90
         
91
-        $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName;
91
+        $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName;
92 92
         $themeFolder = Yii::getAlias($basePath);
93 93
         
94 94
         if (file_exists($themeFolder)) {
95
-            return $this->outputError("The folder " . $themeFolder . " exists already.");
95
+            return $this->outputError("The folder ".$themeFolder." exists already.");
96 96
         }
97 97
     
98
-        $this->outputInfo("Theme path alias: " . $basePath);
99
-        $this->outputInfo("Theme real path: " . $themeFolder);
98
+        $this->outputInfo("Theme path alias: ".$basePath);
99
+        $this->outputInfo("Theme real path: ".$themeFolder);
100 100
         if (!$this->confirm("Do you want continue?")) {
101 101
             return $this->outputError('Abort by user.');
102 102
         }
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
         ];
111 111
 
112 112
         foreach ($folders as $folder) {
113
-            FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder);
113
+            FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder);
114 114
         }
115 115
         
116 116
         $contents = [
117
-            $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName),
117
+            $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName),
118 118
         ];
119 119
         
120 120
         foreach ($contents as $fileName => $content) {
Please login to merge, or discard this patch.
core/theme/ThemeConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,6 +86,6 @@
 block discarded – undo
86 86
     
87 87
     public function getViewPath(): string
88 88
     {
89
-        return $this->getBasePath() . '/views';
89
+        return $this->getBasePath().'/views';
90 90
     }
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
core/theme/ThemeManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
         $dir = Yii::getAlias($basePath);
49 49
         
50 50
         if (!is_dir($dir) || !is_readable($dir)) {
51
-            throw new Exception('Theme directory not exists or readable: ' . $dir);
51
+            throw new Exception('Theme directory not exists or readable: '.$dir);
52 52
         }
53 53
         
54
-        $themeFile = $dir . '/theme.json';
54
+        $themeFile = $dir.'/theme.json';
55 55
         if (file_exists($themeFile)) {
56 56
             $config = Json::decode(file_get_contents($themeFile)) ?: [];
57 57
         } else {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     
135 135
         if (file_exists(Yii::getAlias('@app/themes'))) {
136 136
             foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) {
137
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
137
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
138 138
             }
139 139
         }
140 140
         
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         
173 173
         $this->_themes[$themeConfig->getBasePath()] = $themeConfig;
174 174
     
175
-        Yii::setAlias('@' . basename($themeConfig->getBasePath()) . 'Theme', $themeConfig->getBasePath());
175
+        Yii::setAlias('@'.basename($themeConfig->getBasePath()).'Theme', $themeConfig->getBasePath());
176 176
     }
177 177
     
178 178
     /**
Please login to merge, or discard this patch.
core/theme/Theme.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
     
61 61
         $pos = strpos($viewPath, '/');
62
-        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views');
62
+        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views');
63 63
         $this->pathMap[$rootPath] = $pathMap;
64 64
     
65 65
         $this->pathMap['@app/views'] = $pathMap;
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
     
80 80
     public function getLayoutPath(): string
81 81
     {
82
-        return $this->viewPath . '/layouts';
82
+        return $this->viewPath.'/layouts';
83 83
     }
84 84
     
85 85
     public function getLayoutFile()
86 86
     {
87
-        return $this->layoutPath . '/' . $this->layout . '.php';
87
+        return $this->layoutPath.'/'.$this->layout.'.php';
88 88
     }
89 89
     
90 90
     public function getResourcePath()
91 91
     {
92
-        return $this->basePath . '/resources';
92
+        return $this->basePath.'/resources';
93 93
     }
94 94
     
95 95
     public function getConfig()
Please login to merge, or discard this patch.
core/traits/ErrorHandlerTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
             $_file = $exception->getFile();
149 149
             $_line = $exception->getLine();
150 150
         } elseif (is_string($exception)) {
151
-            $_message = 'exception string: ' . $exception;
151
+            $_message = 'exception string: '.$exception;
152 152
         } elseif (is_array($exception)) {
153
-            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true);
153
+            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true);
154 154
             $_file = isset($exception['file']) ? $exception['file'] : __FILE__;
155 155
             $_line = isset($exception['line']) ? $exception['line'] : __LINE__;
156 156
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $postContext = [];
215 215
 
216 216
         try {
217
-            $lineInArray = $line -1;
217
+            $lineInArray = $line - 1;
218 218
             // load file from path
219 219
             $fileInfo = file($file, FILE_IGNORE_NEW_LINES);
220 220
             // load file if false from real path
Please login to merge, or discard this patch.