Completed
Pull Request — master (#1979)
by Martin
02:01
created
core/helpers/StringHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             return true;
97 97
         }
98 98
         
99
-        return ($value == (string)(float) $value);
99
+        return ($value == (string) (float) $value);
100 100
     }
101 101
     
102 102
     /**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         // we could not find any match, therefore use casual truncate method.
206 206
         if ($first === false) {
207 207
             // as the length value in truncate middle stands for to the left and to the right, we multiple this value with 2
208
-            return self::truncate($content, ($length*2), $affix);
208
+            return self::truncate($content, ($length * 2), $affix);
209 209
         }
210 210
 
211 211
         $last = $first + mb_strlen($word);
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 
218 218
         // string before
219 219
         $before = (count($left) > $length) ? $affix.implode("", array_slice($left, -$length)) : implode("", $left);
220
-        $after = (count($right) > $length) ? implode("", array_slice($right, 0, $length)) . $affix : implode("", $right);
220
+        $after = (count($right) > $length) ? implode("", array_slice($right, 0, $length)).$affix : implode("", $right);
221 221
 
222
-        return $before . implode("", $middle) . $after;
222
+        return $before.implode("", $middle).$after;
223 223
     }
224 224
 
225 225
     /**
Please login to merge, or discard this patch.
core/lazyload/LazyLoad.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function run()
152 152
     {
153
-        $class = ($this->placeholderSrc ? 'lazyimage-wrapper' : 'lazy-image') . ' ' . $this->extraClass;
153
+        $class = ($this->placeholderSrc ? 'lazyimage-wrapper' : 'lazy-image').' '.$this->extraClass;
154 154
 
155 155
         if ($this->placeholderSrc && $this->placeholderAsBase64) {
156
-            $this->placeholderSrc = 'data:image/jpg;base64,' . base64_encode(file_get_contents($this->placeholderSrc));
156
+            $this->placeholderSrc = 'data:image/jpg;base64,'.base64_encode(file_get_contents($this->placeholderSrc));
157 157
         }
158 158
 
159 159
         if ($this->attributesOnly && !$this->placeholderSrc) {
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
         }
162 162
 
163 163
         if ($this->placeholderSrc) {
164
-            $tag = '<div class="' . $class . '">';
164
+            $tag = '<div class="'.$class.'">';
165 165
             $tag .= Html::tag('img', '', ['class' => 'lazy-image lazyimage', 'data-src' => $this->src]);
166 166
             $tag .= Html::tag('img', '', ['class' => 'lazyimage-placeholder-image', 'src' => $this->placeholderSrc]);
167
-            $tag .= '<noscript><img class="lazyimage-image" src="' . $this->src . '" /></noscript>';
167
+            $tag .= '<noscript><img class="lazyimage-image" src="'.$this->src.'" /></noscript>';
168 168
             $tag .= '</div>';
169 169
         } else {
170 170
             $tag = Html::tag('img', '', ['class' => $class, 'data-src' => $this->src, 'data-width' => $this->width, 'data-height' => $this->height]);
171 171
             if ($this->width && $this->height) {
172
-                $tag .= '<div class="lazy-placeholder ' . $class .'"><div style="display: block; height: 0px; padding-bottom: ' . ($this->height / $this->width) * 100 . '%;"></div><div class="loader"></div></div>';
172
+                $tag .= '<div class="lazy-placeholder '.$class.'"><div style="display: block; height: 0px; padding-bottom: '.($this->height / $this->width) * 100.'%;"></div><div class="loader"></div></div>';
173 173
             }
174 174
             $tag .= '<noscript><img class="'.$class.'" src="'.$this->src.'" /></noscript>';
175 175
         }
Please login to merge, or discard this patch.
core/base/ModuleReflection.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         
217 217
         return [
218 218
             'module' => $this->module->id,
219
-            'route' => $this->module->id . '/' . $request['route'],
219
+            'route' => $this->module->id.'/'.$request['route'],
220 220
             'params' => $request['originalArgs'],
221 221
         ];
222 222
     }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             throw new NotFoundHttpException(sprintf("Unable to create controller '%s' for module '%s'.", $requestRoute['route'], $this->module->id));
238 238
         }
239 239
         
240
-        Yii::debug('LUYA module run module "'.$this->module->id.'" route ' . $requestRoute['route'], __METHOD__);
240
+        Yii::debug('LUYA module run module "'.$this->module->id.'" route '.$requestRoute['route'], __METHOD__);
241 241
         
242 242
         $this->controller = $controller[0];
243 243
         $originalController = Yii::$app->controller;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
          *
249 249
          * @see https://github.com/luyadev/luya/issues/1730
250 250
          */
251
-        $this->controller->on(Controller::EVENT_BEFORE_ACTION, function ($event) {
251
+        $this->controller->on(Controller::EVENT_BEFORE_ACTION, function($event) {
252 252
             Yii::$app->controller = $this->controller;
253 253
         });
254 254
         /**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
          *
257 257
          * @see https://github.com/luyadev/luya/issues/1768
258 258
          */
259
-        $this->controller->on(Controller::EVENT_AFTER_ACTION, function ($event) use ($originalController) {
259
+        $this->controller->on(Controller::EVENT_AFTER_ACTION, function($event) use ($originalController) {
260 260
             Yii::$app->controller = $originalController;
261 261
         });
262 262
         
Please login to merge, or discard this patch.
core/web/EmailLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
      */
62 62
     public function getHref()
63 63
     {
64
-        return empty($this->getEmail()) ? null : 'mailto:' . $this->getEmail();
64
+        return empty($this->getEmail()) ? null : 'mailto:'.$this->getEmail();
65 65
     }
66 66
 
67 67
     /**
Please login to merge, or discard this patch.
core/helpers/ArrayHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     public static function search(array $array, $searchText, $sensitive = false)
148 148
     {
149 149
         $function = ($sensitive) ? 'strpos' : 'stripos';
150
-        return array_filter($array, function ($item) use ($searchText, $function) {
150
+        return array_filter($array, function($item) use ($searchText, $function) {
151 151
             $response = false;
152 152
             foreach ($item as $key => $value) {
153 153
                 if ($response) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $array = array_values($array); // align array keys
191 191
         $columns = array_column($array, $column);
192 192
         $key = array_search($search, $columns);
193
-        return ($key !== false) ?  $array[$key] : false;
193
+        return ($key !== false) ? $array[$key] : false;
194 194
     }
195 195
     
196 196
     /**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      */
223 223
     public static function searchColumns(array $array, $column, $search)
224 224
     {
225
-        $keys = array_filter($array, function ($var) use ($column, $search) {
225
+        $keys = array_filter($array, function($var) use ($column, $search) {
226 226
             return strcasecmp($search, $var[$column]) == 0 ? true : false;
227 227
         });
228 228
         
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
         $array = array_combine($range, $range);
263 263
         
264 264
         if ($text) {
265
-            array_walk($array, function (&$item, $key) use ($text) {
265
+            array_walk($array, function(&$item, $key) use ($text) {
266 266
                 if (is_array($text)) {
267 267
                     list($singular, $plural) = $text;
268 268
                     if ($key == 1) {
Please login to merge, or discard this patch.
core/helpers/ExportHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         $output = null;
141 141
         foreach ($input as $row) {
142
-            $output.= self::generateRow($row, $delimiter, '"');
142
+            $output .= self::generateRow($row, $delimiter, '"');
143 143
         }
144 144
 
145 145
         return $output;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     protected static function generateRow(array $row, $delimiter, $enclose)
158 158
     {
159
-        array_walk($row, function (&$item) use ($enclose) {
159
+        array_walk($row, function(&$item) use ($enclose) {
160 160
             if (is_bool($item)) {
161 161
                 $item = (int) $item;
162 162
             } elseif (is_null($item)) {
@@ -171,6 +171,6 @@  discard block
 block discarded – undo
171 171
             ], $item).$enclose;
172 172
         });
173 173
 
174
-        return implode($delimiter, $row) . PHP_EOL;
174
+        return implode($delimiter, $row).PHP_EOL;
175 175
     }
176 176
 }
Please login to merge, or discard this patch.
core/theme/ThemeManager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,18 +53,18 @@  discard block
 block discarded – undo
53 53
         if (strpos($basePath, '@') === 0) {
54 54
             $dir = Yii::getAlias($basePath);
55 55
         } elseif (strpos($basePath, '/') !== 0) {
56
-            $dir = $basePath = Yii::$app->basePath . DIRECTORY_SEPARATOR . $basePath;
56
+            $dir = $basePath = Yii::$app->basePath.DIRECTORY_SEPARATOR.$basePath;
57 57
         } else {
58 58
             $dir = $basePath;
59 59
         }
60 60
         
61 61
         if (!is_dir($dir) || !is_readable($dir)) {
62
-            throw new Exception('Theme directory not exists or readable: ' . $dir);
62
+            throw new Exception('Theme directory not exists or readable: '.$dir);
63 63
         }
64 64
         
65
-        $themeFile = $dir . '/theme.json';
65
+        $themeFile = $dir.'/theme.json';
66 66
         if (!file_exists($themeFile)) {
67
-            throw new InvalidConfigException('Theme config file missing at: ' . $themeFile);
67
+            throw new InvalidConfigException('Theme config file missing at: '.$themeFile);
68 68
         }
69 69
         
70 70
         $config = Json::decode(file_get_contents($themeFile)) ?: [];
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         
160 160
         if (file_exists(Yii::getAlias('@app/themes'))) {
161 161
             foreach (glob(Yii::getAlias('@app/themes/*')) as $dirPath) {
162
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
162
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
163 163
             }
164 164
         }
165 165
         
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         
206 206
         $this->_themes[$basePath] = $themeConfig;
207 207
         
208
-        Yii::setAlias('@' . basename($basePath) . 'Theme', $basePath);
208
+        Yii::setAlias('@'.basename($basePath).'Theme', $basePath);
209 209
     }
210 210
     
211 211
     /**
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
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         }
75 75
     
76 76
         $pos = strpos($viewPath, '/');
77
-        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views');
77
+        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views');
78 78
         $this->pathMap[$rootPath] = $pathMap;
79 79
     
80 80
         $this->pathMap['@app/views'] = $pathMap;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function getLayoutPath()
111 111
     {
112
-        return $this->viewPath . '/' . self::LAYOUTS_PATH;
112
+        return $this->viewPath.'/'.self::LAYOUTS_PATH;
113 113
     }
114 114
     
115 115
     /**
Please login to merge, or discard this patch.
core/console/commands/ThemeController.php 1 patch
Spacing   +7 added lines, -7 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
     
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
             }
60 60
         }
61 61
         
62
-        $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName;
62
+        $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName;
63 63
         $themeFolder = Yii::getAlias($basePath);
64 64
     
65 65
         if (file_exists($themeFolder)) {
66
-            return $this->outputError("The folder " . $themeFolder . " exists already.");
66
+            return $this->outputError("The folder ".$themeFolder." exists already.");
67 67
         }
68 68
     
69
-        $this->outputInfo("Theme path alias: " . $basePath);
70
-        $this->outputInfo("Theme real path: " . $themeFolder);
69
+        $this->outputInfo("Theme path alias: ".$basePath);
70
+        $this->outputInfo("Theme real path: ".$themeFolder);
71 71
         if (!$this->confirm("Do you want continue?")) {
72 72
             return $this->outputError('Abort by user.');
73 73
         }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
         ];
82 82
 
83 83
         foreach ($folders as $folder) {
84
-            FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder);
84
+            FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder);
85 85
         }
86 86
         
87 87
         $contents = [
88
-            $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName),
88
+            $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName),
89 89
         ];
90 90
         
91 91
         foreach ($contents as $fileName => $content) {
Please login to merge, or discard this patch.