Completed
Push — master ( 309e74...095771 )
by Basil
02:09
created
core/console/commands/BaseCrudController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
         }
75 75
         $rules = [];
76 76
         foreach ($types as $type => $columns) {
77
-            $rules[] = "[['" . implode("', '", $columns) . "'], '$type']";
77
+            $rules[] = "[['".implode("', '", $columns)."'], '$type']";
78 78
         }
79 79
         foreach ($lengths as $length => $columns) {
80
-            $rules[] = "[['" . implode("', '", $columns) . "'], 'string', 'max' => $length]";
80
+            $rules[] = "[['".implode("', '", $columns)."'], 'string', 'max' => $length]";
81 81
         }
82 82
         $db = $this->getDbConnection();
83 83
         // Unique indexes rules
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
                 if (!$this->isColumnAutoIncremental($table, $uniqueColumns)) {
89 89
                     $attributesCount = count($uniqueColumns);
90 90
                     if ($attributesCount === 1) {
91
-                        $rules[] = "[['" . $uniqueColumns[0] . "'], 'unique']";
91
+                        $rules[] = "[['".$uniqueColumns[0]."'], 'unique']";
92 92
                     } elseif ($attributesCount > 1) {
93 93
                         $labels = array_intersect_key($this->generateLabels($table), array_flip($uniqueColumns));
94 94
                         $lastLabel = array_pop($labels);
95 95
                         $columnsList = implode("', '", $uniqueColumns);
96
-                        $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of " . implode(', ', $labels) . " and $lastLabel has already been taken.']";
96
+                        $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of ".implode(', ', $labels)." and $lastLabel has already been taken.']";
97 97
                     }
98 98
                 }
99 99
             }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $fullTableName = $tableName;
137 137
         if (($pos = strrpos($tableName, '.')) !== false) {
138 138
             if (($useSchemaName === null && $this->useSchemaName) || $useSchemaName) {
139
-                $schemaName = substr($tableName, 0, $pos) . '_';
139
+                $schemaName = substr($tableName, 0, $pos).'_';
140 140
             }
141 141
             $tableName = substr($tableName, $pos + 1);
142 142
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             if (($pos = strrpos($pattern, '.')) !== false) {
150 150
                 $pattern = substr($pattern, $pos + 1);
151 151
             }
152
-            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
152
+            $patterns[] = '/^'.str_replace('*', '(\w+)', $pattern).'$/';
153 153
         }
154 154
         $className = $tableName;
155 155
         foreach ($patterns as $pattern) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             } else {
194 194
                 $label = Inflector::camel2words($column->name);
195 195
                 if (!empty($label) && substr_compare($label, ' id', -3, 3, true) === 0) {
196
-                    $label = substr($label, 0, -3) . ' ID';
196
+                    $label = substr($label, 0, -3).' ID';
197 197
                 }
198 198
                 $labels[$column->name] = $label;
199 199
             }
Please login to merge, or discard this patch.
core/base/BaseBootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             // see if the module has a registerComponents method
101 101
             foreach ($module->registerComponents() as $componentId => $definition) {
102 102
                 if (!$app->has($componentId)) {
103
-                    Yii::trace('Register component ' . $componentId, __METHOD__);
103
+                    Yii::trace('Register component '.$componentId, __METHOD__);
104 104
                     $app->set($componentId, $definition);
105 105
                 }
106 106
             }
Please login to merge, or discard this patch.
core/console/commands/ModuleController.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -17,6 +17,7 @@
 block discarded – undo
17 17
     /**
18 18
      * Humanize the class name
19 19
      *
20
+     * @param string $name
20 21
      * @return string The humanized name.
21 22
      */
22 23
     public function humanizeName($name)
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -106,23 +106,23 @@  discard block
 block discarded – undo
106 106
             }
107 107
         }
108 108
         
109
-        $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'modules';
110
-        $moduleFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $moduleName;
109
+        $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'modules';
110
+        $moduleFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$moduleName;
111 111
         
112 112
         if (file_exists($moduleFolder)) {
113
-            return $this->outputError("The folder " . $moduleFolder . " exists already.");
113
+            return $this->outputError("The folder ".$moduleFolder." exists already.");
114 114
         }
115 115
         
116 116
         $folders = [
117 117
             'basePath' => $moduleFolder,
118
-            'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin',
119
-            'adminAwsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'aws',
120
-            'adminMigrationPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'migrations',
121
-            'frontendPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend',
122
-            'frontendBlocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'blocks',
123
-            'frontendControllersPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'controllers',
124
-            'frontendViewsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'views',
125
-            'modelsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'models',
118
+            'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin',
119
+            'adminAwsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'aws',
120
+            'adminMigrationPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'migrations',
121
+            'frontendPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend',
122
+            'frontendBlocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'blocks',
123
+            'frontendControllersPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'controllers',
124
+            'frontendViewsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'views',
125
+            'modelsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'models',
126 126
         ];
127 127
 
128 128
         $ns = 'app\\modules\\'.$moduleName;
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
         }
133 133
         
134 134
         $contents = [
135
-            $moduleFolder. DIRECTORY_SEPARATOR . 'README.md' => $this->renderReadme($folders, $moduleName, $ns),
136
-            $moduleFolder. DIRECTORY_SEPARATOR . 'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns),
137
-            $moduleFolder. DIRECTORY_SEPARATOR . 'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns),
135
+            $moduleFolder.DIRECTORY_SEPARATOR.'README.md' => $this->renderReadme($folders, $moduleName, $ns),
136
+            $moduleFolder.DIRECTORY_SEPARATOR.'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns),
137
+            $moduleFolder.DIRECTORY_SEPARATOR.'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns),
138 138
         ];
139 139
         
140 140
         foreach ($contents as $fileName => $content) {
Please login to merge, or discard this patch.
core/web/UrlManager.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@
 block discarded – undo
187 187
      * Remove the base url from a route
188 188
      *
189 189
      * @param string $route The route where the baseUrl should be removed from.
190
-     * @return mixed
190
+     * @return string
191 191
      */
192 192
     public function removeBaseUrl($route)
193 193
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $length = strlen($composition);
95 95
         $route = $parsedRequest[0];
96 96
         
97
-        if (substr($route, 0, $length+1) == $composition.'/') {
97
+        if (substr($route, 0, $length + 1) == $composition.'/') {
98 98
             $parsedRequest[0] = substr($parsedRequest[0], $length);
99 99
         }
100 100
         
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
         $params = (array) $params;
303 303
         $url = $this->internalCreateUrl($params);
304 304
         if (strpos($url, '://') === false) {
305
-            $url = $this->getHostInfo() . $url;
305
+            $url = $this->getHostInfo().$url;
306 306
         }
307 307
         if (is_string($scheme) && ($pos = strpos($url, '://')) !== false) {
308
-            $url = $scheme . substr($url, $pos);
308
+            $url = $scheme.substr($url, $pos);
309 309
         }
310 310
         return $url;
311 311
     }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace luya\web;
4 4
 
5 5
 use Yii;
6
-
7 6
 use yii\web\BadRequestHttpException;
8 7
 use yii\web\NotFoundHttpException;
9 8
 
Please login to merge, or discard this patch.
core/base/Widget.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
         // get reflection
40 40
         $class = new ReflectionClass($this);
41 41
         // get path with alias
42
-        return '@app/views/widgets/' . Inflector::camel2id($class->getShortName());
42
+        return '@app/views/widgets/'.Inflector::camel2id($class->getShortName());
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
core/TagParser.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
     {
124 124
         if (!is_object($this->tags[$tag])) {
125 125
             $this->tags[$tag] = Yii::createObject($this->tags[$tag]);
126
-            Yii::trace('tag parser object generated for:'. $tag, __CLASS__);
126
+            Yii::trace('tag parser object generated for:'.$tag, __CLASS__);
127 127
         }
128 128
     }
129 129
     
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -116,6 +116,7 @@
 block discarded – undo
116 116
     
117 117
     /**
118 118
      * Internal method to add a tag into the tags array.
119
+     * @param string $identifier
119 120
      */
120 121
     private function addTag($identifier, $tagObjectConfig)
121 122
     {
Please login to merge, or discard this patch.
core/console/commands/HealthController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         
47 47
         @chdir(Yii::getAlias('@app'));
48 48
 
49
-        $this->output('The directory the health commands is applying to: ' . Yii::getAlias('@app'));
49
+        $this->output('The directory the health commands is applying to: '.Yii::getAlias('@app'));
50 50
         
51 51
         foreach ($this->folders as $folder => $writable) {
52 52
             $mode = ($writable) ? 0777 : 0775;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     /**
36 36
      * Create all required directories an check whether they are writeable or not.
37 37
      *
38
-     * @return string The action output.
38
+     * @return integer The action output.
39 39
      */
40 40
     public function actionIndex()
41 41
     {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     /**
87 87
      * Test Mail-Component (Use --verbose=1 to enable smtp debug output)
88 88
      *
89
-     * @return boolean Whether successfull or not.
89
+     * @return integer|null Whether successfull or not.
90 90
      * @throws \Exception On smtp failure
91 91
      */
92 92
     public function actionMailer()
Please login to merge, or discard this patch.
core/tag/tags/TelTag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      */
50 50
     public function parse($value, $sub)
51 51
     {
52
-        return Html::a(empty($sub) ? $value : $sub, 'tel:' . $this->ensureNumber($value));
52
+        return Html::a(empty($sub) ? $value : $sub, 'tel:'.$this->ensureNumber($value));
53 53
     }
54 54
         
55 55
     private function ensureNumber($number)
Please login to merge, or discard this patch.
core/Yii.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,5 +18,5 @@
 block discarded – undo
18 18
 }
19 19
 
20 20
 spl_autoload_register(['Yii', 'autoload'], true, true);
21
-Yii::$classMap = require(LUYA_YII_VENDOR . '/classes.php');
21
+Yii::$classMap = require(LUYA_YII_VENDOR.'/classes.php');
22 22
 Yii::$container = new yii\di\Container();
Please login to merge, or discard this patch.