Passed
Push — master ( 644c03...ce1e0e )
by Andrey
07:03
created
views/admin/products/view.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 /* @var $model Product */
15 15
 
16 16
 $this->title = $model->getDefaultTranslate('title');
17
-$this->params['breadcrumbs'][] = [
17
+$this->params[ 'breadcrumbs' ][ ] = [
18 18
     'label' => Yii::t('products', 'Products'),
19 19
     'url' => [
20
-        $this->params['urlPrefix'].'index'
20
+        $this->params[ 'urlPrefix' ].'index'
21 21
     ]
22 22
 ];
23
-$this->params['breadcrumbs'][] = $this->title;
23
+$this->params[ 'breadcrumbs' ][ ] = $this->title;
24 24
 ?>
25 25
 
26 26
 <style>
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
 
35 35
     <p>
36 36
         <?php echo Html::a(Yii::t('app', 'Update'), [
37
-            $this->params['urlPrefix'].'update',
37
+            $this->params[ 'urlPrefix' ].'update',
38 38
             'id' => $model->id
39 39
         ], [
40 40
             'class' => 'btn btn-primary'
41 41
         ]) ?>
42 42
 
43 43
         <?php echo Html::a(Yii::t('app', 'Delete'), [
44
-            $this->params['urlPrefix'].'delete',
44
+            $this->params[ 'urlPrefix' ].'delete',
45 45
             'id' => $model->id
46 46
         ], [
47 47
             'class' => 'btn btn-danger',
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
                 'label' => Yii::t('app', 'Icon'),
89 89
                 'value' => function($model) {
90 90
                     /* @var $model Product */
91
-                    return Html::tag('i', '', ['class' => empty($model->icon) ? 'fa fa-file fa-2x' : $model->icon]);
91
+                    return Html::tag('i', '', [ 'class' => empty($model->icon) ? 'fa fa-file fa-2x' : $model->icon ]);
92 92
                 },
93 93
                 'format' => 'raw',
94 94
             ],
95 95
             'thumbnail' => [
96 96
                 'label' => MFUModule::t('main', 'Thumbnail'),
97
-                'value' => function ($model) {
97
+                'value' => function($model) {
98 98
                     /* @var $model Product */
99 99
                     $thumbnailModel = $model->getThumbnailModel();
100 100
                     return $thumbnailModel == null ? '' : Html::a($model->getDefaultThumbImage(), Url::to($thumbnailModel->getThumbUrl(MFUModule::THUMB_ALIAS_LARGE)), [
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
                 'label' => Yii::t('app', 'Active status'),
108 108
                 'value' => function($model) {
109 109
                     /* @var $model Product */
110
-                    if ($model->active == 1){
111
-                        return '<i class="fa fa-check-circle text-success"> ' . Yii::t('app', 'Active') . '</i>';
110
+                    if ($model->active == 1) {
111
+                        return '<i class="fa fa-check-circle text-success"> '.Yii::t('app', 'Active').'</i>';
112 112
                     } else {
113
-                        return '<i class="fa fa-times text-danger"> ' . Yii::t('app', 'Inactive') . '</i>';
113
+                        return '<i class="fa fa-times text-danger"> '.Yii::t('app', 'Inactive').'</i>';
114 114
                     }
115 115
                 },
116 116
                 'format' => 'raw',
117 117
             ],
118 118
             [
119 119
                 'label' => Yii::t('products', 'Parent page'),
120
-                'value' => function ($model) {
120
+                'value' => function($model) {
121 121
                     /* @var $model Product */
122 122
                     return null === $model->page ? '' : Html::a(
123 123
                         $model->page->getDefaultTranslate('title'),
124
-                        Url::to(['/'.$this->params['shortLanguage'].'/admin/pages/view', 'id' => $model->page->id]),
124
+                        Url::to([ '/'.$this->params[ 'shortLanguage' ].'/admin/pages/view', 'id' => $model->page->id ]),
125 125
                         [
126 126
                             'target' => '_blank'
127 127
                         ]
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
             ],
132 132
             [
133 133
                 'attribute' => 'created_at',
134
-                'format' =>  ['date', 'dd.MM.Y HH:mm:ss'],
134
+                'format' =>  [ 'date', 'dd.MM.Y HH:mm:ss' ],
135 135
                 'label' => Yii::t('app', 'Created date'),
136 136
             ],
137 137
             [
138 138
                 'attribute' => 'updated_at',
139
-                'format' =>  ['date', 'dd.MM.Y HH:mm:ss'],
139
+                'format' =>  [ 'date', 'dd.MM.Y HH:mm:ss' ],
140 140
                 'label' => Yii::t('app', 'Updated date'),
141 141
             ],
142 142
         ],
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     return Html::a(
156 156
                         $item->getDefaultThumbImage(),
157 157
                         Url::to([
158
-                            '/'.$this->params['shortLanguage'].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id
158
+                            '/'.$this->params[ 'shortLanguage' ].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id
159 159
                         ])
160 160
                     );
161 161
                 },
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                     return Html::a(
169 169
                         Html::encode($item->title),
170 170
                         Url::to([
171
-                            '/'.$this->params['shortLanguage'].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id
171
+                            '/'.$this->params[ 'shortLanguage' ].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id
172 172
                         ])
173 173
                     );
174 174
                 },
Please login to merge, or discard this patch.
views/admin/products/create.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 /* @var $albums Itstructure\MFUploader\models\album\Album[] */
7 7
 
8 8
 $this->title = Yii::t('products', 'Create product');
9
-$this->params['breadcrumbs'][] = [
9
+$this->params[ 'breadcrumbs' ][ ] = [
10 10
     'label' => Yii::t('products', 'Products'),
11 11
     'url' => [
12
-        $this->params['urlPrefix'].'index'
12
+        $this->params[ 'urlPrefix' ].'index'
13 13
     ]
14 14
 ];
15
-$this->params['breadcrumbs'][] = Yii::t('app', 'Create');
15
+$this->params[ 'breadcrumbs' ][ ] = Yii::t('app', 'Create');
16 16
 ?>
17 17
 <div class="product-create">
18 18
 
Please login to merge, or discard this patch.
views/admin/mediafiles/_existing-mediafiles.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 </style>
29 29
 
30 30
 <div class="row">
31
-    <?php $i=0; ?>
31
+    <?php $i = 0; ?>
32 32
     <?php foreach ($mediafiles as $mediafile): ?>
33 33
         <div class="col-md-6 file-item">
34
-            <?php $i+=1; ?>
34
+            <?php $i += 1; ?>
35 35
             <div class="media">
36 36
                 <div class="media-left" id="mediafile-container-<?php echo $i; ?>">
37 37
                     <?php echo $mediafile->getPreview($baseUrl, 'existing', $mediafile->isImage() ? [
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                                 'target' => '_blank'
43 43
                             ]
44 44
                         ]
45
-                    ] : []); ?>
45
+                    ] : [ ]); ?>
46 46
                 </div>
47 47
                 <div class="media-body">
48 48
                     <h4 id="title-container-<?php echo $i; ?>" class="media-heading">
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                     'buttonName' => Module::t('main', 'Set '.$fileType),
61 61
                     'resetButtonName' => Module::t('main', 'Clear'),
62 62
                     'options' => [
63
-                        'id' => Html::getInputId($model, $fileType) . '-' . $i,
63
+                        'id' => Html::getInputId($model, $fileType).'-'.$i,
64 64
                         'value' => $mediafile->{FileSetter::INSERTED_DATA_ID},
65 65
                     ],
66 66
                     'deleteBoxDisplay' => true,
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
                     'deleteBoxOptions' => [
69 69
                         'value' => $mediafile->id
70 70
                     ],
71
-                    'mediafileContainer' => '#mediafile-container-' . $i,
72
-                    'titleContainer' => '#title-container-' . $i,
73
-                    'descriptionContainer' => '#description-container-' . $i,
71
+                    'mediafileContainer' => '#mediafile-container-'.$i,
72
+                    'titleContainer' => '#title-container-'.$i,
73
+                    'descriptionContainer' => '#description-container-'.$i,
74 74
                     'subDir' => $model->mainModel->tableName()
75 75
                 ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([
76 76
                     'ownerAttribute' => $fileType
77
-                ], $ownerParams) : [])
77
+                ], $ownerParams) : [ ])
78 78
             ); ?>
79 79
         </div>
80 80
     <?php endforeach; ?>
81 81
 </div>
82 82
 
83
-<?php echo LinkPager::widget(['pagination' => $pages]) ?>
83
+<?php echo LinkPager::widget([ 'pagination' => $pages ]) ?>
Please login to merge, or discard this patch.
views/admin/mediafiles/_thumbnail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
         'subDir' => $model->mainModel->tableName()
29 29
     ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([
30 30
         'ownerAttribute' => UploadModelInterface::FILE_TYPE_THUMB
31
-    ], $ownerParams) : [])
31
+    ], $ownerParams) : [ ])
32 32
 ); ?>
Please login to merge, or discard this patch.
views/admin/mediafiles/_new-mediafiles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
         'buttonName' => Module::t('main', 'Set '.$fileType),
29 29
         'resetButtonName' => Module::t('main', 'Clear'),
30 30
         'options' => [
31
-            'id' => Html::getInputId($model, $fileType) . (isset($number) ? '-new-' . $number : '')
31
+            'id' => Html::getInputId($model, $fileType).(isset($number) ? '-new-'.$number : '')
32 32
         ],
33
-        'mediafileContainer' => '#mediafile-container-new' . (isset($number) ? '-' . $number : ''),
34
-        'titleContainer' => '#title-container-new' . (isset($number) ? '-' . $number : ''),
35
-        'descriptionContainer' => '#description-container-new' . (isset($number) ? '-' . $number : ''),
33
+        'mediafileContainer' => '#mediafile-container-new'.(isset($number) ? '-'.$number : ''),
34
+        'titleContainer' => '#title-container-new'.(isset($number) ? '-'.$number : ''),
35
+        'descriptionContainer' => '#description-container-new'.(isset($number) ? '-'.$number : ''),
36 36
         'subDir' => $model->mainModel->tableName()
37 37
     ], isset($ownerParams) && is_array($ownerParams) ? ArrayHelper::merge([
38 38
         'ownerAttribute' => $fileType
39
-    ], $ownerParams) : [])
39
+    ], $ownerParams) : [ ])
40 40
 ); ?>
Please login to merge, or discard this patch.
config/admin/admin.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     ],
Please login to merge, or discard this patch.
config/admin/main-menu.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'),
Please login to merge, or discard this patch.
config/preview-options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
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.