@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | 'home' => HomeController::class, |
| 61 | 61 | 'sitemap' => SitemapController::class |
| 62 | 62 | ], |
| 63 | - 'accessRoles' => ['admin', 'manager'], |
|
| 63 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 64 | 64 | 'components' => [ |
| 65 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 66 | - 'multilanguage-validate-component' => require __DIR__ .'/multilanguage-validate-component.php', |
|
| 65 | + 'view' => require __DIR__.'/view-component.php', |
|
| 66 | + 'multilanguage-validate-component' => require __DIR__.'/multilanguage-validate-component.php', |
|
| 67 | 67 | ], |
| 68 | 68 | 'isMultilanguage' => true, |
| 69 | 69 | ], |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | 'permissions' => PermissionController::class, |
| 76 | 76 | 'profiles' => ProfileController::class |
| 77 | 77 | ], |
| 78 | - 'accessRoles' => ['admin', 'manager'], |
|
| 78 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 79 | 79 | 'components' => [ |
| 80 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 80 | + 'view' => require __DIR__.'/view-component.php', |
|
| 81 | 81 | ], |
| 82 | 82 | ], |
| 83 | 83 | 'mfuploader' => [ |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | 'text-album' => TextAlbumController::class, |
| 95 | 95 | 'other-album' => OtherAlbumController::class, |
| 96 | 96 | ], |
| 97 | - 'accessRoles' => ['admin', 'manager'], |
|
| 97 | + 'accessRoles' => [ 'admin', 'manager' ], |
|
| 98 | 98 | 'defaultStorageType' => MFUModule::STORAGE_TYPE_LOCAL, |
| 99 | - 'previewOptions' => require __DIR__ . '/../preview-options.php', |
|
| 99 | + 'previewOptions' => require __DIR__.'/../preview-options.php', |
|
| 100 | 100 | 'components' => [ |
| 101 | 101 | 'local-upload-component' => [ |
| 102 | 102 | 'class' => LocalUploadComponent::class, |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | 's3-upload-component' => [ |
| 106 | 106 | 'class' => S3UploadComponent::class, |
| 107 | 107 | 'checkExtensionByMimeType' => false, |
| 108 | - 'credentials' => require __DIR__ . '/../aws-credentials.php', |
|
| 108 | + 'credentials' => require __DIR__.'/../aws-credentials.php', |
|
| 109 | 109 | 'region' => 'us-west-2', |
| 110 | 110 | 's3DefaultBucket' => 'filesmodule2', |
| 111 | 111 | ], |
| 112 | - 'view' => require __DIR__ . '/view-component.php', |
|
| 112 | + 'view' => require __DIR__.'/view-component.php', |
|
| 113 | 113 | ], |
| 114 | 114 | ] |
| 115 | 115 | ], |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | use Itstructure\AdminModule\Module as AdminModule; |
| 4 | 4 | use Itstructure\RbacModule\Module as RbacModule; |
| 5 | 5 | |
| 6 | -$shortLanguage = $this->view->params['shortLanguage']; |
|
| 6 | +$shortLanguage = $this->view->params[ 'shortLanguage' ]; |
|
| 7 | 7 | $controllerId = Yii::$app->controller->id; |
| 8 | 8 | |
| 9 | 9 | return [ |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'active' => $controllerId == 'profiles' ? true : false |
| 51 | 51 | ], |
| 52 | 52 | ], |
| 53 | - 'active' => in_array($controllerId, ['roles', 'permissions', 'profiles']) ? true : false |
|
| 53 | + 'active' => in_array($controllerId, [ 'roles', 'permissions', 'profiles' ]) ? true : false |
|
| 54 | 54 | ], |
| 55 | 55 | 'positions' => [ |
| 56 | 56 | 'title' => Yii::t('positions', 'Positions'), |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'active' => $controllerId == 'qualities' ? true : false |
| 101 | 101 | ], |
| 102 | 102 | ], |
| 103 | - 'active' => in_array($controllerId, ['about', 'technologies', 'qualities']) ? true : false |
|
| 103 | + 'active' => in_array($controllerId, [ 'about', 'technologies', 'qualities' ]) ? true : false |
|
| 104 | 104 | ], |
| 105 | 105 | 'contacts' => [ |
| 106 | 106 | 'title' => Yii::t('contacts', 'Contacts'), |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | 'active' => $controllerId == 'social' ? true : false |
| 121 | 121 | ], |
| 122 | 122 | ], |
| 123 | - 'active' => in_array($controllerId, ['contacts', 'social']) ? true : false |
|
| 123 | + 'active' => in_array($controllerId, [ 'contacts', 'social' ]) ? true : false |
|
| 124 | 124 | ], |
| 125 | 125 | 'home' => [ |
| 126 | 126 | 'title' => Yii::t('home', 'Home page'), |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | 'active' => $controllerId == 'other-album' ? true : false |
| 171 | 171 | ], |
| 172 | 172 | ], |
| 173 | - 'active' => in_array($controllerId, ['image-album', 'audio-album', 'video-album', 'application-album', 'text-album', 'other-album']) ? true : false |
|
| 173 | + 'active' => in_array($controllerId, [ 'image-album', 'audio-album', 'video-album', 'application-album', 'text-album', 'other-album' ]) ? true : false |
|
| 174 | 174 | ], |
| 175 | 175 | 'sitemap' => [ |
| 176 | 176 | 'title' => Yii::t('app', 'Sitemap'), |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | return [ |
| 7 | 7 | UploadModelInterface::FILE_TYPE_APP => [ |
| 8 | - 'existing' => function (Mediafile $mediafile) { |
|
| 8 | + 'existing' => function(Mediafile $mediafile) { |
|
| 9 | 9 | return [ |
| 10 | 10 | 'externalTag' => [ |
| 11 | 11 | 'name' => 'a', |
@@ -99,10 +99,10 @@ discard block |
||
| 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 |
||
| 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; |
@@ -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 | |