Passed
Push — master ( 2de20e...5ce583 )
by Andrey
04:00
created
controllers/admin/ProductController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
     protected function getAdditionFields(): array
100 100
     {
101 101
         if ($this->action->id == 'create' || $this->action->id == 'update') {
102
-            $fields = [];
102
+            $fields = [ ];
103 103
 
104
-            $fields['pages'] = Page::getMenu();
105
-            $fields['albums'] = Album::find()->select([
104
+            $fields[ 'pages' ] = Page::getMenu();
105
+            $fields[ 'albums' ] = Album::find()->select([
106 106
                 'id', 'title'
107 107
             ])->all();
108 108
 
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
                     'defaultPageSize' => 6,
117 117
                     'totalCount' => $mediafilesQuery->count()
118 118
                 ]);
119
-                $fields['images'] = $mediafilesQuery->offset($media_pages->offset)
119
+                $fields[ 'images' ] = $mediafilesQuery->offset($media_pages->offset)
120 120
                     ->limit($media_pages->limit)
121 121
                     ->all();
122
-                $fields['media_pages'] = $media_pages;
122
+                $fields[ 'media_pages' ] = $media_pages;
123 123
             }
124 124
 
125 125
             return $fields;
Please login to merge, or discard this patch.
models/User.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                 'exist',
138 138
                 'skipOnError' => true,
139 139
                 'targetClass' => Position::class,
140
-                'targetAttribute' => ['position_id' => 'id']
140
+                'targetAttribute' => [ 'position_id' => 'id' ]
141 141
             ],
142 142
         ];
143 143
     }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      */
308 308
     public function getFullName(): string
309 309
     {
310
-        return $this->first_name . ' ' . $this->last_name;
310
+        return $this->first_name.' '.$this->last_name;
311 311
     }
312 312
 
313 313
     /**
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      */
433 433
     public function moveOrder(int $order): void
434 434
     {
435
-        if ($order == $this->order){
435
+        if ($order == $this->order) {
436 436
             return;
437 437
         }
438 438
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             ])
444 444
             ->one();
445 445
         $future->detachBehavior('mediafile');
446
-        $future->order = $order > $this->order ? $order-1 : $order+1;
446
+        $future->order = $order > $this->order ? $order - 1 : $order + 1;
447 447
         $future->save();
448 448
 
449 449
         $this->detachBehavior('mediafile');
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
      */
459 459
     public function beforeSave($insert)
460 460
     {
461
-        if ($this->isNewRecord){
461
+        if ($this->isNewRecord) {
462 462
             $this->order = $this->maxOrder == null ? 1 : $this->maxOrder + 1;
463 463
         }
464 464
 
Please login to merge, or discard this patch.
models/QualityBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,8 @@
 block discarded – undo
96 96
     {
97 97
         $scenarios = parent::scenarios();
98 98
 
99
-        $scenarios[ModelInterface::SCENARIO_CREATE][] = 'about';
100
-        $scenarios[ModelInterface::SCENARIO_UPDATE][] = 'about';
99
+        $scenarios[ ModelInterface::SCENARIO_CREATE ][ ] = 'about';
100
+        $scenarios[ ModelInterface::SCENARIO_UPDATE ][ ] = 'about';
101 101
 
102 102
         return $scenarios;
103 103
     }
Please login to merge, or discard this patch.
models/Technology.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $scenarios = parent::scenarios();
109 109
 
110
-        $scenarios[self::SCENARIO_CREATE][] = 'about';
111
-        $scenarios[self::SCENARIO_UPDATE][] = 'about';
110
+        $scenarios[ self::SCENARIO_CREATE ][ ] = 'about';
111
+        $scenarios[ self::SCENARIO_UPDATE ][ ] = 'about';
112 112
 
113 113
         return $scenarios;
114 114
     }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function afterSave($insert, $changedAttributes)
155 155
     {
156
-        $this->linkWithAbout(empty($this->about) ? [] : $this->about);
156
+        $this->linkWithAbout(empty($this->about) ? [ ] : $this->about);
157 157
 
158 158
         parent::afterSave($insert, $changedAttributes);
159 159
     }
Please login to merge, or discard this patch.
models/Social.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
     {
105 105
         $scenarios = parent::scenarios();
106 106
 
107
-        $scenarios[self::SCENARIO_CREATE][] = 'contacts';
108
-        $scenarios[self::SCENARIO_UPDATE][] = 'contacts';
107
+        $scenarios[ self::SCENARIO_CREATE ][ ] = 'contacts';
108
+        $scenarios[ self::SCENARIO_UPDATE ][ ] = 'contacts';
109 109
 
110 110
         return $scenarios;
111 111
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function afterSave($insert, $changedAttributes)
153 153
     {
154
-        $this->linkWithContacts(empty($this->contacts) ? [] : $this->contacts);
154
+        $this->linkWithContacts(empty($this->contacts) ? [ ] : $this->contacts);
155 155
 
156 156
         parent::afterSave($insert, $changedAttributes);
157 157
     }
Please login to merge, or discard this patch.
traits/ThumbnailTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @return mixed
28 28
      */
29
-    public function getDefaultThumbImage(array $options = [])
29
+    public function getDefaultThumbImage(array $options = [ ])
30 30
     {
31 31
         $url = $this->getDefaultThumbUrl();
32 32
 
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
             return null;
35 35
         }
36 36
 
37
-        if (empty($options['alt'])) {
38
-            $options['alt'] = $this->thumbnailModel->alt;
37
+        if (empty($options[ 'alt' ])) {
38
+            $options[ 'alt' ] = $this->thumbnailModel->alt;
39 39
         }
40 40
 
41 41
         return Html::img($url, $options);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function getDefaultThumbUrl()
50 50
     {
51
-        if (null == $this->getThumbnailModel()){
51
+        if (null == $this->getThumbnailModel()) {
52 52
             return null;
53 53
         }
54 54
 
Please login to merge, or discard this patch.
models/sitemap/SitemapProduct.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @var array [langId => langCode]
29 29
      */
30
-    public $sitemapLanguages = [];
30
+    public $sitemapLanguages = [ ];
31 31
     /**
32 32
      * If TRUE - Yii::$app->language will be switched for each sitemapLanguages and restored after.
33 33
      *
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         return static::find()
62 62
             ->with([
63
-                'productsLanguages' => function ($query) use ($lang) {
63
+                'productsLanguages' => function($query) use ($lang) {
64 64
                     /** @var \yii\db\Query $query */
65 65
                     $query->andWhere([
66 66
                         'language_id' => Language::findOne([
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function getSitemapLoc($lang = null)
84 84
     {
85
-        return Url::to('/' . $lang . '/product/' . $this->alias, true);
85
+        return Url::to('/'.$lang.'/product/'.$this->alias, true);
86 86
     }
87 87
 
88 88
     /**
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function getSitemapAlternateLinks()
118 118
     {
119
-        $buffer = [];
119
+        $buffer = [ ];
120 120
 
121 121
         foreach ($this->sitemapLanguages as $langCode) {
122
-            $buffer[$langCode] = $this->getSitemapLoc($langCode);
122
+            $buffer[ $langCode ] = $this->getSitemapLoc($langCode);
123 123
         }
124 124
 
125 125
         return $buffer;
Please login to merge, or discard this patch.
models/sitemap/SitemapPage.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @var array [langId => langCode]
29 29
      */
30
-    public $sitemapLanguages = [];
30
+    public $sitemapLanguages = [ ];
31 31
     /**
32 32
      * If TRUE - Yii::$app->language will be switched for each sitemapLanguages and restored after.
33 33
      *
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         return static::find()
62 62
             ->with([
63
-                'pagesLanguages' => function ($query) use ($lang) {
63
+                'pagesLanguages' => function($query) use ($lang) {
64 64
                     /** @var \yii\db\Query $query */
65 65
                     $query->andWhere([
66 66
                         'language_id' => Language::findOne([
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function getSitemapLoc($lang = null)
84 84
     {
85
-        return Url::to('/' . $lang . '/page/' . $this->alias, true);
85
+        return Url::to('/'.$lang.'/page/'.$this->alias, true);
86 86
     }
87 87
 
88 88
     /**
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function getSitemapAlternateLinks()
118 118
     {
119
-        $buffer = [];
119
+        $buffer = [ ];
120 120
 
121 121
         foreach ($this->sitemapLanguages as $langCode) {
122
-            $buffer[$langCode] = $this->getSitemapLoc($langCode);
122
+            $buffer[ $langCode ] = $this->getSitemapLoc($langCode);
123 123
         }
124 124
 
125 125
         return $buffer;
Please login to merge, or discard this patch.
models/FeedbackSearch.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * @var array
18 18
      */
19
-    public $delete_items = [];
19
+    public $delete_items = [ ];
20 20
 
21 21
     const SCENARIO_DELETE_SELECTED = 'delete_selected';
22 22
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             Model::scenarios(),
55 55
             parent::scenarios(),
56 56
             [
57
-                self::SCENARIO_DELETE_SELECTED => ['delete_items']
57
+                self::SCENARIO_DELETE_SELECTED => [ 'delete_items' ]
58 58
             ]
59 59
         );
60 60
     }
@@ -118,6 +118,6 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function deleteSelected()
120 120
     {
121
-        return static::deleteAll(['id' => $this->delete_items]);
121
+        return static::deleteAll([ 'id' => $this->delete_items ]);
122 122
     }
123 123
 }
Please login to merge, or discard this patch.