Test Setup Failed
Push — master ( 74be6c...acfd94 )
by Александр
38:24
created
src/views/admin-component-settings/index.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,10 +23,11 @@  discard block
 block discarded – undo
23 23
         </button>
24 24
         <small><?= \Yii::t('skeeks/cms',
25 25
                 'The settings for this component are stored in the database. This option will erase them from the database, but the component, restore the default values. As they have in the code the developer.') ?></small>
26
-    <?php else
26
+    <?php else {
27 27
         : ?>
28 28
         <small><?= \Yii::t('skeeks/cms', 'These settings not yet saved in the database') ?></small>
29 29
     <?php endif;
30
+}
30 31
     ?>
31 32
 </div>
32 33
 
@@ -45,9 +46,12 @@  discard block
 block discarded – undo
45 46
     ]))->render(); ?>
46 47
 <? elseif ($formContent = $component->renderConfigForm($form)) : ?>
47 48
     <?= $formContent; ?>
48
-<? else : ?>
49
+<? else {
50
+    : ?>
49 51
     Нет редактируемых настроек для данного компонента
50
-<? endif; ?>
52
+<? endif;
53
+}
54
+?>
51 55
 
52 56
 <?= $form->buttonsStandart($component); ?>
53 57
 <?= $form->errorSummary(\yii\helpers\ArrayHelper::merge(
Please login to merge, or discard this patch.
src/base/Widget.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         \Yii::$app->cmsToolbar->initEnabled();
84 84
         if (\Yii::$app->cmsToolbar->editWidgets == Cms::BOOL_Y && \Yii::$app->cmsToolbar->enabled) {
85
-            $id = 'sx-infoblock-'.$this->id;
85
+            $id = 'sx-infoblock-' . $this->id;
86 86
 
87 87
             return Html::beginTag('div',
88 88
                 [
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
 
127 127
     public function init()
128 128
     {
129
-        $this->_token = \Yii::t('skeeks/cms', 'Widget').': '.$this->id;
130
-        \Yii::beginProfile("Cms Widget: ".$this->_token);
129
+        $this->_token = \Yii::t('skeeks/cms', 'Widget') . ': ' . $this->id;
130
+        \Yii::beginProfile("Cms Widget: " . $this->_token);
131 131
         parent::init();
132
-        \Yii::endProfile("Cms Widget: ".$this->_token);
132
+        \Yii::endProfile("Cms Widget: " . $this->_token);
133 133
     }
134 134
     /**
135 135
      * @return string
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
     {
139 139
         if (YII_ENV == 'prod') {
140 140
             try {
141
-                \Yii::beginProfile("Run: ".$this->_token);
141
+                \Yii::beginProfile("Run: " . $this->_token);
142 142
                 $content = $this->_run();
143
-                \Yii::endProfile("Run: ".$this->_token);
143
+                \Yii::endProfile("Run: " . $this->_token);
144 144
             } catch (\Exception $e) {
145 145
                 $content = \Yii::t('skeeks/cms', 'Error widget {class}',
146
-                        ['class' => $this->className()])." (".$this->descriptor->name."): ".$e->getMessage();
146
+                        ['class' => $this->className()]) . " (" . $this->descriptor->name . "): " . $e->getMessage();
147 147
             }
148 148
         } else {
149
-            \Yii::beginProfile("Run: ".$this->_token);
149
+            \Yii::beginProfile("Run: " . $this->_token);
150 150
             $content = $this->_run();
151
-            \Yii::endProfile("Run: ".$this->_token);
151
+            \Yii::endProfile("Run: " . $this->_token);
152 152
         }
153 153
 
154 154
         if ($this->_isBegin) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $result = "";
178 178
 
179 179
         if (\Yii::$app->cmsToolbar->editWidgets == Cms::BOOL_Y && \Yii::$app->cmsToolbar->enabled) {
180
-            $id = 'sx-infoblock-'.$this->id;
180
+            $id = 'sx-infoblock-' . $this->id;
181 181
 
182 182
             $this->view->registerJs(<<<JS
183 183
 new sx.classes.toolbar.EditViewBlock({'id' : '{$id}'});
Please login to merge, or discard this patch.
src/base/Component.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $this->_callAttributes = $this->attributes;
188 188
 
189
-        \Yii::beginProfile("Init: ".static::class);
189
+        \Yii::beginProfile("Init: " . static::class);
190 190
 
191 191
         if (!\Yii::$app instanceof Application) {
192 192
             if ($this->cmsSite === null && isset(\Yii::$app->currentSite) && \Yii::$app->currentSite->site) {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
         $this->trigger(self::EVENT_INIT);
204 204
 
205
-        \Yii::endProfile("Init: ".static::class);
205
+        \Yii::endProfile("Init: " . static::class);
206 206
     }
207 207
 
208 208
     /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             $this->_oldAttributes = $this->toArray($this->safeAttributes());
218 218
         } catch (\Exception $e) {
219 219
             \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings',
220
-                    ['cms' => 'Cms']).': '.$e->getMessage());
220
+                    ['cms' => 'Cms']) . ': ' . $e->getMessage());
221 221
         }
222 222
 
223 223
         return $this;
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
         if ($models = $this->getConfigFormModels()) {
529 529
             foreach ($models as $key => $model) {
530
-                $value[$key."Array"] = $model->attributes;
530
+                $value[$key . "Array"] = $model->attributes;
531 531
             }
532 532
         }
533 533
 
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
      */
711 711
     public function getCallableId()
712 712
     {
713
-        return $this->settingsId.'-callable';
713
+        return $this->settingsId . '-callable';
714 714
     }
715 715
 
716 716
     /**
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
     public function getSettingsId($autoGenerate = true)
722 722
     {
723 723
         if ($autoGenerate && $this->_settingsId === null) {
724
-            $this->_settingsId = static::$autoSettingsIdPrefix.static::$counterSettings++;
724
+            $this->_settingsId = static::$autoSettingsIdPrefix . static::$counterSettings++;
725 725
         }
726 726
 
727 727
         return $this->_settingsId;
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
         if (isset($this->{$name})) {
806 806
             $this->{$name} = $value;
807 807
         } else {
808
-            throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".');
808
+            throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".');
809 809
         }
810 810
     }
811 811
 
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
         if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) {
856 856
             $this->_oldAttributes[$name] = $value;
857 857
         } else {
858
-            throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".');
858
+            throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".');
859 859
         }
860 860
     }
861 861
 
Please login to merge, or discard this patch.
src/controllers/ImagingController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $extension = Imaging::getExtension($newFileSrc);
44 44
 
45 45
         if (!$extension) {
46
-            throw new \yii\base\Exception("Extension not found: ".$newFileSrc);
46
+            throw new \yii\base\Exception("Extension not found: " . $newFileSrc);
47 47
         }
48 48
 
49 49
 
@@ -53,31 +53,31 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
         $newFile = File::object($newFileSrc);
56
-        $strposFilter = strpos($newFileSrc, "/".Imaging::THUMBNAIL_PREFIX);
56
+        $strposFilter = strpos($newFileSrc, "/" . Imaging::THUMBNAIL_PREFIX);
57 57
         if (!$strposFilter) {
58
-            throw new NotFoundHttpException("This is not a filter thumbnail: ".$newFileSrc);
58
+            throw new NotFoundHttpException("This is not a filter thumbnail: " . $newFileSrc);
59 59
         }
60 60
 
61
-        $originalFileSrc = substr($newFileSrc, 0, $strposFilter).".".$newFile->getExtension();
61
+        $originalFileSrc = substr($newFileSrc, 0, $strposFilter) . "." . $newFile->getExtension();
62 62
 
63 63
         //TODO: hardcode delete it in the future
64 64
         $webRoot = \Yii::getAlias('@webroot');
65 65
 
66
-        $originalFileRoot = $webRoot.DIRECTORY_SEPARATOR.$originalFileSrc;
67
-        $newFileRoot = $webRoot.DIRECTORY_SEPARATOR.$newFileSrc;
68
-        $newFileRootDefault = $webRoot.DIRECTORY_SEPARATOR.str_replace($newFile->getBaseName(),
69
-                Imaging::DEFAULT_THUMBNAIL_FILENAME.".".$extension, $newFileSrc);
66
+        $originalFileRoot = $webRoot . DIRECTORY_SEPARATOR . $originalFileSrc;
67
+        $newFileRoot = $webRoot . DIRECTORY_SEPARATOR . $newFileSrc;
68
+        $newFileRootDefault = $webRoot . DIRECTORY_SEPARATOR . str_replace($newFile->getBaseName(),
69
+                Imaging::DEFAULT_THUMBNAIL_FILENAME . "." . $extension, $newFileSrc);
70 70
 
71 71
         $originalFile = new File($originalFileRoot);
72 72
 
73 73
         if (!$originalFile->isExist()) {
74
-            throw new NotFoundHttpException("The original file is not found: ".$newFileSrc);
74
+            throw new NotFoundHttpException("The original file is not found: " . $newFileSrc);
75 75
         }
76 76
 
77 77
         //Проверено наличие оригинального файла, есть пути к оригиналу, и результирующему файлу.
78 78
         //Отслось собрать фильтр, и проверить наличие параметров. А так же проверить разрешены ли эти параметры, для этого в строке есть захэшированный ключь
79 79
 
80
-        $filterSting = substr($newFileSrc, ($strposFilter + strlen(DIRECTORY_SEPARATOR.Imaging::THUMBNAIL_PREFIX)),
80
+        $filterSting = substr($newFileSrc, ($strposFilter + strlen(DIRECTORY_SEPARATOR . Imaging::THUMBNAIL_PREFIX)),
81 81
             strlen($newFileSrc));
82 82
         $filterCode = explode("/", $filterSting);
83 83
         $filterCode = $filterCode[0]; //Код фильтра
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
         if ($params = \Yii::$app->request->get()) {
87 87
             $pramsCheckArray = explode(DIRECTORY_SEPARATOR, $filterSting);
88 88
             if (count($pramsCheckArray) < 3) {
89
-                throw new \yii\base\Exception("the control line not found: ".$newFileSrc);
89
+                throw new \yii\base\Exception("the control line not found: " . $newFileSrc);
90 90
             }
91 91
 
92 92
             $string = $imaging->getParamsCheckString($params);
93 93
             if ($pramsCheckArray[1] != $string) {
94
-                throw new \yii\base\Exception("Parameters invalid: ".$newFileSrc);
94
+                throw new \yii\base\Exception("Parameters invalid: " . $newFileSrc);
95 95
             }
96 96
         }
97 97
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 
101 101
         if (!class_exists($filterClass)) {
102
-            throw new \ErrorException("Filter class is not created: ".$newFileSrc);
102
+            throw new \ErrorException("Filter class is not created: " . $newFileSrc);
103 103
         }
104 104
 
105 105
         /**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
          */
108 108
         $filter = new $filterClass((array)$params);
109 109
         if (!is_subclass_of($filter, Filter::className())) {
110
-            throw new NotFoundHttpException("No child filter class: ".$newFileSrc);
110
+            throw new NotFoundHttpException("No child filter class: " . $newFileSrc);
111 111
         }
112 112
 
113 113
         try {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 }
129 129
             }
130 130
 
131
-            $url = \Yii::$app->request->getUrl().($params ?
131
+            $url = \Yii::$app->request->getUrl() . ($params ?
132 132
                     ""//"?" . http_build_query($params) . '&sx-refresh'
133 133
                     : '?sx-refresh');
134 134
 
Please login to merge, or discard this patch.
src/widgets/views/dual-select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 $hidden = $widget->items;
15 15
 $visible = [];
16
-$values = (array) $widget->model->{$widget->attribute};
16
+$values = (array)$widget->model->{$widget->attribute};
17 17
 
18 18
 foreach ($values as $value)
19 19
 {
Please login to merge, or discard this patch.
src/widgets/DualSelect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $this->options['multiple'] = true;
79 79
 
80
-        $items = (array) $this->model->{$this->attribute};
80
+        $items = (array)$this->model->{$this->attribute};
81 81
         $selectedItems = [];
82 82
         if ($items) {
83 83
             foreach ($items as $value)
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             }
87 87
         }
88 88
 
89
-        $element = Html::activeListBox($this->model, $this->attribute, (array) $selectedItems, $this->options);
89
+        $element = Html::activeListBox($this->model, $this->attribute, (array)$selectedItems, $this->options);
90 90
 
91 91
         echo $this->render('dual-select', [
92 92
             'element' => $element,
Please login to merge, or discard this patch.
src/components/storage/ClusterLocal.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
         $clusterFileSrc = $clusterFileName;
58 58
 
59 59
         if ($localPath) {
60
-            $clusterFileSrc = $localPath.DIRECTORY_SEPARATOR.$clusterFileSrc;
60
+            $clusterFileSrc = $localPath . DIRECTORY_SEPARATOR . $clusterFileSrc;
61 61
         }
62 62
 
63 63
         try {
64
-            $dir = new Dir($dir.DIRECTORY_SEPARATOR.$localPath);
64
+            $dir = new Dir($dir . DIRECTORY_SEPARATOR . $localPath);
65 65
             $resultFile = $dir->newFile($clusterFileName);
66 66
             $tmpFile->move($resultFile);
67 67
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         if ($this->publicBaseUrlIsAbsolute) {
120 120
             return $this->getPublicSrc($clusterFileUniqSrc);
121 121
         } else {
122
-            return \Yii::$app->urlManager->hostInfo.$this->getPublicSrc($clusterFileUniqSrc);
122
+            return \Yii::$app->urlManager->hostInfo . $this->getPublicSrc($clusterFileUniqSrc);
123 123
         }
124 124
     }
125 125
     /**
Please login to merge, or discard this patch.
src/widgets/GridView.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                                         'hiddenLabel' => \Yii::t('skeeks/cms', 'Hidden columns'),
132 132
                                     ],
133 133
                                     //'multiple'        => true,
134
-                                    'on beforeRender' => function ($e) {
134
+                                    'on beforeRender' => function($e) {
135 135
                                         /**
136 136
                                          * @var $widgetField WidgetField
137 137
                                          */
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                         ['pageSizeLimitMax', 'integer'],
226 226
                     ],
227 227
                 ],
228
-            ], (array) $this->configBehaviorData),
228
+            ], (array)$this->configBehaviorData),
229 229
         ]);
230 230
     }
231 231
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 }
271 271
 
272 272
                 if ($result && in_array($label, array_values($result))) {
273
-                    $result[$code] = $label." ({$code})";
273
+                    $result[$code] = $label . " ({$code})";
274 274
                 } else {
275 275
                     $result[$code] = $label;
276 276
                 }
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                         $this->_autoColumns[(string)$name] = [
427 427
                             'attribute' => $name,
428 428
                             'format'    => 'raw',
429
-                            'value'     => function ($model, $key, $index) use ($name, $keyName) {
429
+                            'value'     => function($model, $key, $index) use ($name, $keyName) {
430 430
                                 return $model->{$keyName};
431 431
                             },
432 432
                         ];
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                         $this->_autoColumns[(string)$name] = [
435 435
                             'attribute' => $name,
436 436
                             'format'    => 'raw',
437
-                            'value'     => function ($model, $key, $index) use ($name, $keyManyName) {
437
+                            'value'     => function($model, $key, $index) use ($name, $keyManyName) {
438 438
                                 return count($model->{$keyManyName});
439 439
                             },
440 440
                         ];
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                         $this->_autoColumns[(string)$name] = [
443 443
                             'attribute' => $name,
444 444
                             'format'    => 'raw',
445
-                            'value'     => function ($model, $key, $index) use ($name) {
445
+                            'value'     => function($model, $key, $index) use ($name) {
446 446
                                 if (is_array($model->{$name})) {
447 447
                                     return implode(",", $model->{$name});
448 448
                                 } else {
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         }
511 511
 
512 512
         if ($resultColumns) {
513
-            $resultColumns = ArrayHelper::merge((array) $resultColumns, (array) $columns);
513
+            $resultColumns = ArrayHelper::merge((array)$resultColumns, (array)$columns);
514 514
             $columns = $resultColumns;
515 515
         }
516 516
 
Please login to merge, or discard this patch.
src/widgets/SortSelect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->options['multiple'] = true;
63 63
 
64
-        $items = (array) $this->model->{$this->attribute};
64
+        $items = (array)$this->model->{$this->attribute};
65 65
         $selectedItems = [];
66 66
         if ($items) {
67 67
             foreach ($items as $value)
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             }
71 71
         }
72 72
 
73
-        $element = Html::activeListBox($this->model, $this->attribute, (array) $selectedItems, $this->options);
73
+        $element = Html::activeListBox($this->model, $this->attribute, (array)$selectedItems, $this->options);
74 74
 
75 75
         echo $this->render('sort-select', [
76 76
             'element' => $element,
Please login to merge, or discard this patch.