@@ -137,7 +137,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -96,8 +96,8 @@ |
||
| 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 | } |
@@ -107,8 +107,8 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -104,8 +104,8 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -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 | * |
@@ -60,7 +60,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -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 | * |
@@ -60,7 +60,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -16,7 +16,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -10,17 +10,17 @@ discard block |
||
| 10 | 10 | /* @var $this Itstructure\AdminModule\components\AdminView */ |
| 11 | 11 | |
| 12 | 12 | $this->title = Yii::t('feedback', 'Feedback'); |
| 13 | -$this->params['breadcrumbs'][] = $this->title; |
|
| 13 | +$this->params[ 'breadcrumbs' ][ ] = $this->title; |
|
| 14 | 14 | ?> |
| 15 | 15 | <div class="feedback-index"> |
| 16 | 16 | |
| 17 | - <?php echo $this->render('_search', ['model' => $searchModel]); ?> |
|
| 17 | + <?php echo $this->render('_search', [ 'model' => $searchModel ]); ?> |
|
| 18 | 18 | |
| 19 | - <?php echo LinkPager::widget(['pagination' => $dataProvider->getPagination()]) ?> |
|
| 19 | + <?php echo LinkPager::widget([ 'pagination' => $dataProvider->getPagination() ]) ?> |
|
| 20 | 20 | |
| 21 | 21 | <?php $form = ActiveForm::begin([ |
| 22 | 22 | 'action' => [ |
| 23 | - $this->params['urlPrefix'].'delete-selected' |
|
| 23 | + $this->params[ 'urlPrefix' ].'delete-selected' |
|
| 24 | 24 | ], |
| 25 | 25 | 'method' => 'post', |
| 26 | 26 | ]); ?> |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | ], |
| 62 | 62 | [ |
| 63 | 63 | 'attribute' => 'created_at', |
| 64 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
| 64 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
| 65 | 65 | 'label' => Yii::t('app', 'Created date'), |
| 66 | 66 | ], |
| 67 | 67 | [ |
| 68 | 68 | 'attribute' => 'updated_at', |
| 69 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
| 69 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
| 70 | 70 | 'label' => Yii::t('app', 'Updated date'), |
| 71 | 71 | ], |
| 72 | 72 | 'read' => [ |
@@ -74,8 +74,7 @@ discard block |
||
| 74 | 74 | 'value' => function($searchModel) { |
| 75 | 75 | /* @var $searchModel FeedbackSearch */ |
| 76 | 76 | return $searchModel->read === 1 ? |
| 77 | - '<i class="fa fa-check-circle text-success"> ' . Yii::t('feedback', 'Read') . '</i>' : |
|
| 78 | - '<i class="text-danger">' . Yii::t('feedback', 'New') . '</i>'; |
|
| 77 | + '<i class="fa fa-check-circle text-success"> '.Yii::t('feedback', 'Read').'</i>' : '<i class="text-danger">'.Yii::t('feedback', 'New').'</i>'; |
|
| 79 | 78 | }, |
| 80 | 79 | 'format' => 'raw', |
| 81 | 80 | ], |
@@ -83,9 +82,9 @@ discard block |
||
| 83 | 82 | 'class' => 'yii\grid\ActionColumn', |
| 84 | 83 | 'header' => Yii::t('app', 'Actions'), |
| 85 | 84 | 'template' => '{view} {delete}', |
| 86 | - 'urlCreator'=>function($action, $model, $key, $index){ |
|
| 85 | + 'urlCreator'=>function($action, $model, $key, $index) { |
|
| 87 | 86 | return Url::to([ |
| 88 | - $this->params['urlPrefix'].$action, |
|
| 87 | + $this->params[ 'urlPrefix' ].$action, |
|
| 89 | 88 | 'id' => $model->id |
| 90 | 89 | ]); |
| 91 | 90 | } |
@@ -95,8 +94,8 @@ discard block |
||
| 95 | 94 | 'header' => Yii::t('app', 'Delete'), |
| 96 | 95 | 'multiple' => true, |
| 97 | 96 | 'name' => Html::getInputName($searchModel, 'delete_items'), |
| 98 | - 'checkboxOptions' => function ($searchModel, $key, $index, $column) use ($form) { |
|
| 99 | - return ['form' => $form->id, 'value' => $searchModel->id]; |
|
| 97 | + 'checkboxOptions' => function($searchModel, $key, $index, $column) use ($form) { |
|
| 98 | + return [ 'form' => $form->id, 'value' => $searchModel->id ]; |
|
| 100 | 99 | } |
| 101 | 100 | ], |
| 102 | 101 | ], |
@@ -104,7 +103,7 @@ discard block |
||
| 104 | 103 | |
| 105 | 104 | <?php if ($dataProvider->count > 0): ?> |
| 106 | 105 | <div class="form-group"> |
| 107 | - <?php echo Html::submitButton(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-primary']) ?> |
|
| 106 | + <?php echo Html::submitButton(Yii::t('app', 'Delete selected'), [ 'class' => 'btn btn-primary' ]) ?> |
|
| 108 | 107 | </div> |
| 109 | 108 | <?php endif; ?> |
| 110 | 109 | |