@@ -27,7 +27,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -96,7 +96,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -69,7 +69,7 @@ |
||
| 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(); |
@@ -76,18 +76,18 @@ |
||
| 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 | } |
@@ -174,8 +174,8 @@ |
||
| 174 | 174 | if ($this->save()) { |
| 175 | 175 | Yii::$app->mailer->compose() |
| 176 | 176 | ->setTo($email) |
| 177 | - ->setFrom([$this->email => $this->name]) |
|
| 178 | - ->setSubject('New message from bizness-develop feedback. ' . $this->subject) |
|
| 177 | + ->setFrom([ $this->email => $this->name ]) |
|
| 178 | + ->setSubject('New message from bizness-develop feedback. '.$this->subject) |
|
| 179 | 179 | ->setTextBody($this->message) |
| 180 | 180 | ->send(); |
| 181 | 181 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | 'language_id' |
| 82 | 82 | ], |
| 83 | 83 | 'unique', |
| 84 | - 'targetAttribute' => ['about_id', 'language_id'] |
|
| 84 | + 'targetAttribute' => [ 'about_id', 'language_id' ] |
|
| 85 | 85 | ], |
| 86 | 86 | [ |
| 87 | 87 | [ |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'exist', |
| 91 | 91 | 'skipOnError' => true, |
| 92 | 92 | 'targetClass' => About::class, |
| 93 | - 'targetAttribute' => ['about_id' => 'id'] |
|
| 93 | + 'targetAttribute' => [ 'about_id' => 'id' ] |
|
| 94 | 94 | ], |
| 95 | 95 | [ |
| 96 | 96 | [ |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | 'exist', |
| 100 | 100 | 'skipOnError' => true, |
| 101 | 101 | 'targetClass' => Language::class, |
| 102 | - 'targetAttribute' => ['language_id' => 'id'] |
|
| 102 | + 'targetAttribute' => [ 'language_id' => 'id' ] |
|
| 103 | 103 | ], |
| 104 | 104 | ]; |
| 105 | 105 | } |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | $dataProvider->setSort([ |
| 79 | 79 | 'attributes' => [ |
| 80 | 80 | 'order' => [ |
| 81 | - 'asc' => ['order' => SORT_ASC], |
|
| 82 | - 'desc' => ['order' => SORT_DESC], |
|
| 81 | + 'asc' => [ 'order' => SORT_ASC ], |
|
| 82 | + 'desc' => [ 'order' => SORT_DESC ], |
|
| 83 | 83 | 'label' => 'Order', |
| 84 | 84 | 'default' => SORT_ASC |
| 85 | 85 | ], |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | 'updated_at' => $this->updated_at, |
| 104 | 104 | ]); |
| 105 | 105 | |
| 106 | - $query->andFilterWhere(['like', 'first_name', $this->first_name]) |
|
| 107 | - ->andFilterWhere(['like', 'last_name', $this->last_name]) |
|
| 108 | - ->andFilterWhere(['like', 'patronymic', $this->patronymic]) |
|
| 109 | - ->andFilterWhere(['like', 'position', $this->position]) |
|
| 110 | - ->andFilterWhere(['like', 'login', $this->login]) |
|
| 111 | - ->andFilterWhere(['like', 'email', $this->email]) |
|
| 112 | - ->andFilterWhere(['like', 'phone', $this->phone]); |
|
| 106 | + $query->andFilterWhere([ 'like', 'first_name', $this->first_name ]) |
|
| 107 | + ->andFilterWhere([ 'like', 'last_name', $this->last_name ]) |
|
| 108 | + ->andFilterWhere([ 'like', 'patronymic', $this->patronymic ]) |
|
| 109 | + ->andFilterWhere([ 'like', 'position', $this->position ]) |
|
| 110 | + ->andFilterWhere([ 'like', 'login', $this->login ]) |
|
| 111 | + ->andFilterWhere([ 'like', 'email', $this->email ]) |
|
| 112 | + ->andFilterWhere([ 'like', 'phone', $this->phone ]); |
|
| 113 | 113 | |
| 114 | 114 | $query->orderBy('order ASC'); |
| 115 | 115 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'social_id' |
| 50 | 50 | ], |
| 51 | 51 | 'unique', |
| 52 | - 'targetAttribute' => ['contacts_id', 'social_id'] |
|
| 52 | + 'targetAttribute' => [ 'contacts_id', 'social_id' ] |
|
| 53 | 53 | ], |
| 54 | 54 | [ |
| 55 | 55 | [ |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 'exist', |
| 59 | 59 | 'skipOnError' => true, |
| 60 | 60 | 'targetClass' => Contact::class, |
| 61 | - 'targetAttribute' => ['contacts_id' => 'id'] |
|
| 61 | + 'targetAttribute' => [ 'contacts_id' => 'id' ] |
|
| 62 | 62 | ], |
| 63 | 63 | [ |
| 64 | 64 | [ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | 'exist', |
| 68 | 68 | 'skipOnError' => true, |
| 69 | 69 | 'targetClass' => Social::class, |
| 70 | - 'targetAttribute' => ['social_id' => 'id'] |
|
| 70 | + 'targetAttribute' => [ 'social_id' => 'id' ] |
|
| 71 | 71 | ], |
| 72 | 72 | ]; |
| 73 | 73 | } |