Completed
Push — master ( 352f6d...fa6ea1 )
by Basil
04:37 queued 02:26
created
core/web/Controller.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@
 block discarded – undo
33 33
     {
34 34
         if ($this->module instanceof Module) {
35 35
             if ($this->module->useAppViewPath) {
36
-                return '@app/views/' . $this->module->id . '/' . $this->id;
36
+                return '@app/views/'.$this->module->id.'/'.$this->id;
37 37
             } elseif (is_array($this->module->viewMap)) {
38
-                $currentAction = $this->id . '/' . ($this->action ? $this->action->id : $this->defaultAction);
38
+                $currentAction = $this->id.'/'.($this->action ? $this->action->id : $this->defaultAction);
39 39
                 foreach ($this->module->viewMap as $action => $viewPath) {
40 40
 
41 41
                     // Special case for map all views of controller
42 42
                     if ($action === '*') {
43
-                        return $viewPath . '/' . $this->id;
43
+                        return $viewPath.'/'.$this->id;
44 44
                     } elseif (fnmatch($action, $currentAction)) {
45 45
                         return $viewPath;
46 46
                     }
Please login to merge, or discard this patch.
core/web/Svg.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,25 +100,25 @@  discard block
 block discarded – undo
100 100
     public function run()
101 101
     {
102 102
         // Cache generated code
103
-        return $this->getOrSetHasCache(['svg', $this->folder, $this->file, $this->cssClass], function () {
103
+        return $this->getOrSetHasCache(['svg', $this->folder, $this->file, $this->cssClass], function() {
104 104
 
105 105
             // Check if file ends with .svg, if not add the extension
106
-            $svgFile = StringHelper::endsWith($this->file, '.svg') ? $this->file : $this->file . '.svg';
106
+            $svgFile = StringHelper::endsWith($this->file, '.svg') ? $this->file : $this->file.'.svg';
107 107
 
108 108
             if ($this->symbolMode) {
109
-                $svgPath = Yii::$app->view->publicHtml . '/' . $svgFile;
109
+                $svgPath = Yii::$app->view->publicHtml.'/'.$svgFile;
110 110
 
111
-                return '<svg class="symbol symbol--' . $this->symbolName . '' . ($this->cssClass ? ' ' . $this->cssClass : '') . '"><use class="symbol__use" xlink:href="' . $svgPath . '#' . $this->symbolName . '" /></svg>';
111
+                return '<svg class="symbol symbol--'.$this->symbolName.''.($this->cssClass ? ' '.$this->cssClass : '').'"><use class="symbol__use" xlink:href="'.$svgPath.'#'.$this->symbolName.'" /></svg>';
112 112
             } else {
113 113
                 // Build the full svg file path
114
-                $svgPath = $this->folder . DIRECTORY_SEPARATOR . $svgFile;
114
+                $svgPath = $this->folder.DIRECTORY_SEPARATOR.$svgFile;
115 115
 
116 116
                 // Get the svg contents
117 117
                 $content = FileHelper::getFileContent($svgPath);
118 118
 
119 119
                 // If a cssClass string is given, add it to the <svg> tag
120 120
                 if ($this->cssClass && is_string($this->cssClass)) {
121
-                    $content = preg_replace('/<svg/', '<svg class="' . $this->cssClass . '"', $content);
121
+                    $content = preg_replace('/<svg/', '<svg class="'.$this->cssClass.'"', $content);
122 122
                 }
123 123
 
124 124
                 if ($content) {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                 }
127 127
             }
128 128
 
129
-            throw new Exception('Unable to access SVG File: ' . $svgPath);
129
+            throw new Exception('Unable to access SVG File: '.$svgPath);
130 130
         });
131 131
     }
132 132
 }
Please login to merge, or discard this patch.
core/web/Element.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -255,6 +255,6 @@
 block discarded – undo
255 255
     {
256 256
         $view = new View();
257 257
         $view->autoRegisterCsrf = false;
258
-        return $view->renderPhpFile(rtrim($this->getFolder(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . FileHelper::ensureExtension($file, 'php'), $args);
258
+        return $view->renderPhpFile(rtrim($this->getFolder(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.FileHelper::ensureExtension($file, 'php'), $args);
259 259
     }
260 260
 }
Please login to merge, or discard this patch.
core/helpers/StringHelper.php 2 patches
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.
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,7 +89,6 @@  discard block
 block discarded – undo
89 89
      * ```
90 90
      *
91 91
      * @param $value The value on which the filter conditions should be applied on.
92
-     * @param array|string $filters An array of filter conditions, if a string is given he will be exploded by commas.
93 92
      * @param boolean $caseSensitive Whether to match value even when lower/upper case is not correct/same.
94 93
      * @return bool Returns true if one of the given filter conditions matches.
95 94
      * @since 1.3.0
@@ -170,7 +169,7 @@  discard block
 block discarded – undo
170 169
      * @param string $search Search string to look for.
171 170
      * @param string $replace Replacement value for the first found occurrence.
172 171
      * @param string $subject The string you want to look up to replace the first element.
173
-     * @return mixed Replaced string
172
+     * @return string Replaced string
174 173
      */
175 174
     public static function replaceFirst($search, $replace, $subject)
176 175
     {
@@ -200,7 +199,7 @@  discard block
 block discarded – undo
200 199
      * }
201 200
      * ```
202 201
      *
203
-     * @param string|array $needle The char or word to find in the $haystack. Can be an array to multi find words or char in the string.
202
+     * @param string $needle The char or word to find in the $haystack. Can be an array to multi find words or char in the string.
204 203
      * @param string $haystack The haystack where the $needle string should be looked up. A string or phrase with words.
205 204
      * @param boolean $strict If an array of needles is provided the $strict parameter defines whether all keys must be found ($strict = true) or just one result must be found ($strict = false).
206 205
      * @return boolean If an array of values is provided the response may change depending on $findAll.
@@ -237,7 +236,7 @@  discard block
 block discarded – undo
237 236
      * @param string $content The content to minify.
238 237
      * @param array $options Optional arguments to provide for minification:
239 238
      * - comments: boolean, where html comments should be removed or not. defaults to false
240
-     * @return mixed Returns the minified content.
239
+     * @return string Returns the minified content.
241 240
      * @since 1.0.7
242 241
      */
243 242
     public static function minify($content, array $options = [])
Please login to merge, or discard this patch.
core/web/jsonld/EventTrait.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     /**
170 170
      * The time admission will commence.
171 171
      *
172
-     * @param DateTime $doorTime
172
+     * @param DateTimeValue $doorTime
173 173
      * @return static
174 174
      */
175 175
     public function setDoorTime(DateTimeValue $doorTime)
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     /**
192 192
      * The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.
193 193
      *
194
-     * @param Duration $duration
194
+     * @param DurationValue $duration
195 195
      * @return static
196 196
      */
197 197
     public function setDuration(DurationValue $duration)
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     /**
214 214
      * The end date and time of the item (in ISO 8601 date format).
215 215
      *
216
-     * @param Date|DateTime $endDate
216
+     * @param DateTimeValue $endDate
217 217
      * @return static
218 218
      */
219 219
     public function setEndDate(DateTimeValue $endDate)
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      * Please use one of the language codes from the IETF BCP 47 standard. See also availableLanguage.
262 262
      * Supersedes language.
263 263
      *
264
-     * @param Language|Text $inLanguage
264
+     * @param LanguageValue $inLanguage
265 265
      * @return static
266 266
      */
267 267
     public function setInLanguage(LanguageValue $inLanguage)
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 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     /**
50 50
      * Getter method for the e-mail.
51 51
      *
52
-     * @return string|boolean Returns the e-mail from the setter method, if mail is not valid false is returned.
52
+     * @return string|false Returns the e-mail from the setter method, if mail is not valid false is returned.
53 53
      */
54 54
     public function getEmail()
55 55
     {
Please login to merge, or discard this 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/console/commands/ThemeController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use luya\theme\ThemeConfig;
8 8
 use Yii;
9 9
 use yii\helpers\Console;
10
-use yii\helpers\Inflector;
11 10
 
12 11
 /**
13 12
  * Command to create a new LUYA theme.
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     }
145 145
     
146 146
     /**
147
-     * @param $themeName
147
+     * @param string $themeName
148 148
      *
149 149
      * @return string
150 150
      */
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     }
166 166
     
167 167
     /**
168
-     * @param $themeName
168
+     * @param string $themeName
169 169
      *
170 170
      * @return string
171 171
      */
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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 . '/themes/' . $themeName;
62
+        $basePath = $themeLocation.'/themes/'.$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,15 +81,15 @@  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),
89
-            $themeFolder. DIRECTORY_SEPARATOR . ucfirst($themeName) . 'Asset.php' => $this->renderAssetClass($themeName),
90
-            $themeFolder. DIRECTORY_SEPARATOR . 'resources/'. $themeName .'.css' => '',
91
-            $themeFolder. DIRECTORY_SEPARATOR . 'views/layouts/theme.php' => $this->renderLayout($themeName),
92
-            $themeFolder. DIRECTORY_SEPARATOR . 'views/cmslayouts/theme.php' => $this->renderCmsLayout($themeName),
88
+            $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName),
89
+            $themeFolder.DIRECTORY_SEPARATOR.ucfirst($themeName).'Asset.php' => $this->renderAssetClass($themeName),
90
+            $themeFolder.DIRECTORY_SEPARATOR.'resources/'.$themeName.'.css' => '',
91
+            $themeFolder.DIRECTORY_SEPARATOR.'views/layouts/theme.php' => $this->renderLayout($themeName),
92
+            $themeFolder.DIRECTORY_SEPARATOR.'views/cmslayouts/theme.php' => $this->renderCmsLayout($themeName),
93 93
         ];
94 94
         
95 95
         foreach ($contents as $fileName => $content) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function renderAssetClass($themeName)
152 152
     {
153
-        $className = ucfirst($themeName) . 'Asset';
153
+        $className = ucfirst($themeName).'Asset';
154 154
         return "<?php
155 155
 namespace app\\themes\\{$themeName};
156 156
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     private function renderLayout($themeName)
173 173
     {
174
-        $className = ucfirst($themeName) . 'Asset';
174
+        $className = ucfirst($themeName).'Asset';
175 175
     
176 176
         return '<?php
177 177
 /**
Please login to merge, or discard this patch.
core/traits/ErrorHandlerTrait.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @param string $message The message you want to send to the error api server.
69 69
      * @param string $file The you are currently send the message (use __FILE__)
70
-     * @param string $line The line you want to submit (use __LINE__)
70
+     * @param integer $line The line you want to submit (use __LINE__)
71 71
      * @return bool|null
72 72
      */
73 73
     public function transferMessage($message, $file = __FILE__, $line = __LINE__)
@@ -105,6 +105,7 @@  discard block
 block discarded – undo
105 105
     
106 106
     /**
107 107
      * @inheritdoc
108
+     * @param \Exception $exception
108 109
      */
109 110
     public function renderException($exception)
110 111
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
             $_file = $exception->getFile();
177 177
             $_line = $exception->getLine();
178 178
         } elseif (is_string($exception)) {
179
-            $_message = 'exception string: ' . $exception;
179
+            $_message = 'exception string: '.$exception;
180 180
         } elseif (is_array($exception)) {
181
-            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true);
181
+            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true);
182 182
             $_file = isset($exception['file']) ? $exception['file'] : __FILE__;
183 183
             $_line = isset($exception['line']) ? $exception['line'] : __LINE__;
184 184
         }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
         if (!empty($file)) {
251 251
             try {
252
-                $lineInArray = $line -1;
252
+                $lineInArray = $line - 1;
253 253
                 // load file from path
254 254
                 $fileInfo = file($file, FILE_IGNORE_NEW_LINES);
255 255
                 // load file if false from real path
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
             'class' => isset($item['class']) ? $item['class'] : null,
290 290
             // currently arguments wont be transmited due to large amount of informations based on base object
291 291
             //'args' => isset($item['args']) ? ArrayHelper::coverSensitiveValues($item['args'], $this->sensitiveKeys) : [],
292
-        ], function ($value) {
292
+        ], function($value) {
293 293
             return !empty($value);
294 294
         });
295 295
     }
Please login to merge, or discard this patch.