Passed
Push — master ( 1dbcfe...fe7b3f )
by Andrey
03:34
created
models/sitemap/SitemapAbout.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
      *
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         return [
61 61
             [
62
-                'loc' => Url::to('/' . $lang . '/about', true),
62
+                'loc' => Url::to('/'.$lang.'/about', true),
63 63
                 'lastmod' => $this->getSitemapLastmod(),
64 64
                 'changefreq' => $this->getSitemapChangefreq(),
65 65
                 'priority' => $this->getSitemapPriority(),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function getSitemapLoc($lang = null)
83 83
     {
84
-        return Url::to('/' . $lang . '/about', true);
84
+        return Url::to('/'.$lang.'/about', true);
85 85
     }
86 86
 
87 87
     /**
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getSitemapAlternateLinks()
115 115
     {
116
-        $buffer = [];
116
+        $buffer = [ ];
117 117
 
118 118
         foreach ($this->sitemapLanguages as $langCode) {
119
-            $buffer[$langCode] = $this->getSitemapLoc($langCode);
119
+            $buffer[ $langCode ] = $this->getSitemapLoc($langCode);
120 120
         }
121 121
 
122 122
         return $buffer;
Please login to merge, or discard this patch.
models/sitemap/SitemapHome.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
      *
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         return [
61 61
             [
62
-                'loc' => Url::to('/' . $lang, true),
62
+                'loc' => Url::to('/'.$lang, true),
63 63
                 'lastmod' => $this->getSitemapLastmod(),
64 64
                 'changefreq' => $this->getSitemapChangefreq(),
65 65
                 'priority' => $this->getSitemapPriority(),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function getSitemapLoc($lang = null)
83 83
     {
84
-        return Url::to('/' . $lang, true);
84
+        return Url::to('/'.$lang, true);
85 85
     }
86 86
 
87 87
     /**
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function getSitemapAlternateLinks()
115 115
     {
116
-        $buffer = [];
116
+        $buffer = [ ];
117 117
 
118 118
         foreach ($this->sitemapLanguages as $langCode) {
119
-            $buffer[$langCode] = $this->getSitemapLoc($langCode);
119
+            $buffer[ $langCode ] = $this->getSitemapLoc($langCode);
120 120
         }
121 121
 
122 122
         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->id, true);
85
+        return Url::to('/'.$lang.'/page/'.$this->id, 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/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->id, true);
85
+        return Url::to('/'.$lang.'/product/'.$this->id, 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/User.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 'exist',
141 141
                 'skipOnError' => true,
142 142
                 'targetClass' => Position::class,
143
-                'targetAttribute' => ['position_id' => 'id']
143
+                'targetAttribute' => [ 'position_id' => 'id' ]
144 144
             ],
145 145
         ];
146 146
     }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function getFullName(): string
312 312
     {
313
-        return $this->first_name . ' ' . $this->last_name;
313
+        return $this->first_name.' '.$this->last_name;
314 314
     }
315 315
 
316 316
     /**
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
     {
373 373
         $thumbnailModel = $this->getThumbnailModel();
374 374
 
375
-        if (null === $thumbnailModel){
375
+        if (null === $thumbnailModel) {
376 376
             return '';
377 377
         }
378 378
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
      */
464 464
     public function moveOrder(int $order): void
465 465
     {
466
-        if ($order == $this->order){
466
+        if ($order == $this->order) {
467 467
             return;
468 468
         }
469 469
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
             ])
475 475
             ->one();
476 476
         $future->detachBehavior('mediafile');
477
-        $future->order = $order > $this->order ? $order-1 : $order+1;
477
+        $future->order = $order > $this->order ? $order - 1 : $order + 1;
478 478
         $future->save();
479 479
 
480 480
         $this->detachBehavior('mediafile');
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
      */
490 490
     public function beforeSave($insert)
491 491
     {
492
-        if ($this->isNewRecord){
492
+        if ($this->isNewRecord) {
493 493
             $this->order = $this->maxOrder == null ? 1 : $this->maxOrder + 1;
494 494
         }
495 495
 
Please login to merge, or discard this patch.
models/ContactLanguage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                     'language_id'
97 97
                 ],
98 98
                 'unique',
99
-                'targetAttribute' => ['contacts_id', 'language_id']
99
+                'targetAttribute' => [ 'contacts_id', 'language_id' ]
100 100
             ],
101 101
             [
102 102
                 [
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 'exist',
106 106
                 'skipOnError' => true,
107 107
                 'targetClass' => Contact::class,
108
-                'targetAttribute' => ['contacts_id' => 'id']
108
+                'targetAttribute' => [ 'contacts_id' => 'id' ]
109 109
             ],
110 110
             [
111 111
                 [
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 'exist',
115 115
                 'skipOnError' => true,
116 116
                 'targetClass' => Language::class,
117
-                'targetAttribute' => ['language_id' => 'id']
117
+                'targetAttribute' => [ 'language_id' => 'id' ]
118 118
             ],
119 119
         ];
120 120
     }
Please login to merge, or discard this patch.
models/ProductSearch.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function search($params)
58 58
     {
59
-        $query = Product::find()->joinWith(['productsLanguages']);
59
+        $query = Product::find()->joinWith([ 'productsLanguages' ]);
60 60
 
61 61
         // add conditions that should always apply here
62 62
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
             'active' => $this->active,
79 79
         ]);
80 80
 
81
-        $query->andFilterWhere(['like', 'products_language.title', $this->title]);
81
+        $query->andFilterWhere([ 'like', 'products_language.title', $this->title ]);
82 82
 
83 83
         $pagination = new Pagination([
84
-            'defaultPageSize' => Yii::$app->params['defaultPageSize'],
84
+            'defaultPageSize' => Yii::$app->params[ 'defaultPageSize' ],
85 85
             'totalCount' => $query->count(),
86 86
         ]);
87 87
 
Please login to merge, or discard this patch.
models/ContactForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         if ($this->validate()) {
70 70
             Yii::$app->mailer->compose()
71 71
                 ->setTo($email)
72
-                ->setFrom([$this->email => $this->name])
72
+                ->setFrom([ $this->email => $this->name ])
73 73
                 ->setSubject($this->subject)
74 74
                 ->setTextBody($this->body)
75 75
                 ->send();
Please login to merge, or discard this patch.
models/PageLanguage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,18 +76,18 @@
 block discarded – undo
76 76
                 'max' => 255,
77 77
             ],
78 78
             [
79
-                ['pages_id'],
79
+                [ 'pages_id' ],
80 80
                 'exist',
81 81
                 'skipOnError' => true,
82 82
                 'targetClass' => Page::class,
83
-                'targetAttribute' => ['pages_id' => 'id'],
83
+                'targetAttribute' => [ 'pages_id' => 'id' ],
84 84
             ],
85 85
             [
86
-                ['language_id'],
86
+                [ 'language_id' ],
87 87
                 'exist',
88 88
                 'skipOnError' => true,
89 89
                 'targetClass' => Language::class,
90
-                'targetAttribute' => ['language_id' => 'id'],
90
+                'targetAttribute' => [ 'language_id' => 'id' ],
91 91
             ],
92 92
         ];
93 93
     }
Please login to merge, or discard this patch.