Completed
Pull Request — master (#1936)
by
unknown
01:58
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/theme/ThemeManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         if (strpos($basePath, '@') === 0) {
50 50
             $dir = Yii::getAlias($basePath);
51 51
         } elseif (strpos($basePath, '/') !== 0) {
52
-            $dir = $basePath = Yii::$app->basePath . DIRECTORY_SEPARATOR . $basePath;
52
+            $dir = $basePath = Yii::$app->basePath.DIRECTORY_SEPARATOR.$basePath;
53 53
         }
54 54
         
55 55
         if (!is_dir($dir) || !is_readable($dir)) {
56
-            throw new Exception('Theme directory not exists or readable: ' . $dir);
56
+            throw new Exception('Theme directory not exists or readable: '.$dir);
57 57
         }
58 58
         
59
-        $themeFile = $dir . '/theme.json';
59
+        $themeFile = $dir.'/theme.json';
60 60
         if (file_exists($themeFile)) {
61 61
             $config = Json::decode(file_get_contents($themeFile)) ?: [];
62 62
         } else {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         
153 153
         if (file_exists(Yii::getAlias('@app/themes'))) {
154 154
             foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) {
155
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
155
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
156 156
             }
157 157
         }
158 158
         
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         
191 191
         $this->_themes[$themeConfig->getBasePath()] = $themeConfig;
192 192
         
193
-        Yii::setAlias('@' . basename($themeConfig->getBasePath()) . 'Theme', $themeConfig->getBasePath());
193
+        Yii::setAlias('@'.basename($themeConfig->getBasePath()).'Theme', $themeConfig->getBasePath());
194 194
     }
195 195
     
196 196
     /**
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
         }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         if (!empty($file)) {
217 217
             try {
218
-                $lineInArray = $line -1;
218
+                $lineInArray = $line - 1;
219 219
                 // load file from path
220 220
                 $fileInfo = file($file, FILE_IGNORE_NEW_LINES);
221 221
                 // load file if false from real path
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
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     
48 48
         $availableModules = implode(', ', array_column(Yii::$app->getFrontendModules(), 'id'));
49 49
         $themeLocation = $this->prompt("Enter the theme location where to generate (as path alias e.g. app, $availableModules):", ['default' => 'app']);
50
-        $themeLocation = '@' . ltrim($themeLocation, '@');
50
+        $themeLocation = '@'.ltrim($themeLocation, '@');
51 51
     
52 52
         preg_match("#^@[A-z]+#", $themeLocation, $newThemeLocation);
53 53
         if ($newThemeLocation[0] !== $themeLocation) {
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
             }
59 59
         }
60 60
         
61
-        $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName;
61
+        $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName;
62 62
         $themeFolder = Yii::getAlias($basePath);
63 63
     
64 64
         if (file_exists($themeFolder)) {
65
-            return $this->outputError("The folder " . $themeFolder . " exists already.");
65
+            return $this->outputError("The folder ".$themeFolder." exists already.");
66 66
         }
67 67
     
68
-        $this->outputInfo("Theme path alias: " . $basePath);
69
-        $this->outputInfo("Theme real path: " . $themeFolder);
68
+        $this->outputInfo("Theme path alias: ".$basePath);
69
+        $this->outputInfo("Theme real path: ".$themeFolder);
70 70
         if (!$this->confirm("Do you want continue?")) {
71 71
             return $this->outputError('Abort by user.');
72 72
         }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
         ];
81 81
 
82 82
         foreach ($folders as $folder) {
83
-            FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder);
83
+            FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder);
84 84
         }
85 85
         
86 86
         $contents = [
87
-            $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName),
87
+            $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName),
88 88
         ];
89 89
         
90 90
         foreach ($contents as $fileName => $content) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             $themeConfig->parentTheme = $this->prompt("Enter the base path (e.g. `@app/themes/blank`) of the parent theme:",
111 111
                 [
112 112
                     'default' => '@app/themes/blank',
113
-                    'validator' => function ($input, &$error) {
113
+                    'validator' => function($input, &$error) {
114 114
                         if (preg_match('/^[a-z]+$/', $input) === false) {
115 115
                             $error = 'The theme name must be only letter chars!';
116 116
                             return false;
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
@@ -97,6 +97,6 @@
 block discarded – undo
97 97
     
98 98
     public function getViewPath()
99 99
     {
100
-        return $this->getBasePath() . '/views';
100
+        return $this->getBasePath().'/views';
101 101
     }
102 102
 }
103 103
\ No newline at end of file
Please login to merge, or discard this patch.
core/theme/Theme.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         }
65 65
     
66 66
         $pos = strpos($viewPath, '/');
67
-        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views');
67
+        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views');
68 68
         $this->pathMap[$rootPath] = $pathMap;
69 69
     
70 70
         $this->pathMap['@app/views'] = $pathMap;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     
85 85
     public function getLayoutPath()
86 86
     {
87
-        return $this->viewPath . '/' . self::LAYOUTS_PATH;
87
+        return $this->viewPath.'/'.self::LAYOUTS_PATH;
88 88
     }
89 89
     
90 90
     public function getConfig()
Please login to merge, or discard this patch.