Test Setup Failed
Push — master ( d8ee25...9ef876 )
by Александр
19:37
created
src/models/CmsContentElement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             [
273 273
                 'tree_id',
274 274
                 'default',
275
-                'value' => function () {
275
+                'value' => function() {
276 276
                     if ($this->cmsContent->defaultTree) {
277 277
                         return $this->cmsContent->defaultTree->id;
278 278
                     }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             [
316 316
                 'parent_content_element_id',
317 317
                 'required',
318
-                'when'       => function (CmsContentElement $model) {
318
+                'when'       => function(CmsContentElement $model) {
319 319
 
320 320
                     if ($model->cmsContent && $model->cmsContent->parentContent) {
321 321
                         return (bool)($model->cmsContent->parent_content_is_required == "Y");
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
      */
535 535
     public function getPermissionName()
536 536
     {
537
-        return 'cms/cms-content-element__'.$this->id;
537
+        return 'cms/cms-content-element__' . $this->id;
538 538
     }
539 539
 
540 540
 
Please login to merge, or discard this patch.
src/controllers/AdminCmsContentElementController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
             [
94 94
                 'class'     => \yii\grid\DataColumn::class,
95
-                'value'     => function (\skeeks\cms\models\CmsContentElement $model) {
95
+                'value'     => function(\skeeks\cms\models\CmsContentElement $model) {
96 96
                     if (!$model->cmsTree) {
97 97
                         return null;
98 98
                     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     if ($model->cmsTree->parents) {
103 103
                         foreach ($model->cmsTree->parents as $parent) {
104 104
                             if ($parent->isRoot()) {
105
-                                $path[] = "[".$parent->site->name."] ".$parent->name;
105
+                                $path[] = "[" . $parent->site->name . "] " . $parent->name;
106 106
                             } else {
107 107
                                 $path[] = $parent->name;
108 108
                             }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
             'additionalSections' => [
121 121
                 'class'   => \yii\grid\DataColumn::class,
122
-                'value'   => function (\skeeks\cms\models\CmsContentElement $model) {
122
+                'value'   => function(\skeeks\cms\models\CmsContentElement $model) {
123 123
                     $result = [];
124 124
 
125 125
                     if ($model->cmsContentElementTrees) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             [
148 148
                 'class'  => \yii\grid\DataColumn::class,
149 149
                 'label'  => "Смотреть",
150
-                'value'  => function (\skeeks\cms\models\CmsContentElement $model) {
150
+                'value'  => function(\skeeks\cms\models\CmsContentElement $model) {
151 151
 
152 152
                     return \yii\helpers\Html::a('<i class="glyphicon glyphicon-arrow-right"></i>', $model->absoluteUrl,
153 153
                         [
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                     'visible'   => false,
194 194
                     'format'    => 'raw',
195 195
                     'class'     => \yii\grid\DataColumn::class,
196
-                    'value'     => function ($model, $key, $index) use ($name) {
196
+                    'value'     => function($model, $key, $index) use ($name) {
197 197
                         if (is_array($model->{$name})) {
198 198
                             return implode(",", $model->{$name});
199 199
                         } else {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                     "preContent"     => "Механизм создания копии текущего элемента. Укажите параметры копирования и нажмите применить.",
257 257
                     "successMessage" => "Элемент успешно скопирован",
258 258
 
259
-                    'on initFormModels' => function (Event $e) {
259
+                    'on initFormModels' => function(Event $e) {
260 260
                         $model = $e->sender->model;
261 261
                         $dm = new DynamicModel(['is_copy_images', 'is_copy_files']);
262 262
                         $dm->addRule(['is_copy_images', 'is_copy_files'], 'boolean');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                         $e->sender->formModels['dm'] = $dm;
268 268
                     },
269 269
 
270
-                    'on beforeSave' => function (Event $e) {
270
+                    'on beforeSave' => function(Event $e) {
271 271
                         /**
272 272
                          * @var $action BackendModelUpdateAction;
273 273
                          */
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
                     },
287 287
 
288
-                    'fields' => function () {
288
+                    'fields' => function() {
289 289
                         return [
290 290
                             'dm.is_copy_images' => [
291 291
                                 'class' => BoolField::class,
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
             foreach ((array)ArrayHelper::getValue($formData, 'fields') as $code) {
526 526
                 if ($rpForSave->hasAttribute($code)) {
527 527
                     $rpForSave->setAttribute($code,
528
-                        ArrayHelper::getValue($formData, 'RelatedPropertiesModel.'.$code));
528
+                        ArrayHelper::getValue($formData, 'RelatedPropertiesModel.' . $code));
529 529
                 }
530 530
             }
531 531
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
         $unique = parent::getPermissionName();
570 570
 
571 571
         if ($this->content) {
572
-            $unique = $unique."__".$this->content->id;
572
+            $unique = $unique . "__" . $this->content->id;
573 573
         }
574 574
 
575 575
         return $unique;
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
                         ],
596 596
                 ]);
597 597
 
598
-                $this->_content = CmsContent::getDb()->cache(function ($db) use ($content_id) {
598
+                $this->_content = CmsContent::getDb()->cache(function($db) use ($content_id) {
599 599
                     return CmsContent::find()->where([
600 600
                         "id" => $content_id,
601 601
                     ])->one();
Please login to merge, or discard this patch.