@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | $languages = explode(',', getenv('APP_LANGUAGES')); |
77 | 77 | |
78 | 78 | // prepare asset bundle config |
79 | -$bundles = []; |
|
79 | +$bundles = [ ]; |
|
80 | 80 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
81 | 81 | // include generated asset-bundle configuration |
82 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
82 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
83 | 83 | // disable loading of bundles skin file, when using bundled assets |
84 | 84 | Yii::$container->set( |
85 | 85 | AdminLteAsset::class, |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => 0 |
97 | 97 | ]; |
98 | 98 | if (getenv('MYSQL_ATTR_SSL_CA')) { |
99 | - $dbAttributes[PDO::MYSQL_ATTR_SSL_CA] = getenv('MYSQL_ATTR_SSL_CA'); |
|
99 | + $dbAttributes[ PDO::MYSQL_ATTR_SSL_CA ] = getenv('MYSQL_ATTR_SSL_CA'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | // Enable S3 component, if ENVs are set (BC) |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $common = [ |
118 | 118 | 'id' => 'app', |
119 | 119 | 'name' => getenv('APP_TITLE'), |
120 | - 'language' => $languages[0], |
|
120 | + 'language' => $languages[ 0 ], |
|
121 | 121 | 'basePath' => '@app', |
122 | 122 | 'vendorPath' => '@root/vendor', |
123 | 123 | 'runtimePath' => '@root/runtime', |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ], |
136 | 136 | 'params' => [ |
137 | 137 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
138 | - 'context.menuItems' => [], |
|
138 | + 'context.menuItems' => [ ], |
|
139 | 139 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
140 | 140 | 'backend.browserSupport' => [ |
141 | 141 | 'Chrome' => 87, |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | 'container' => [ |
152 | 152 | 'definitions' => [ |
153 | 153 | AuthDbManagerComponent::class => [ |
154 | - 'defaultRoles' => ['Default'], |
|
154 | + 'defaultRoles' => [ 'Default' ], |
|
155 | 155 | 'cache' => 'cache' |
156 | 156 | ], |
157 | 157 | AdminController::class => [ |
@@ -175,23 +175,23 @@ discard block |
||
175 | 175 | 'rules' => [ |
176 | 176 | [ |
177 | 177 | 'allow' => true, |
178 | - 'actions' => ['index'], |
|
179 | - 'roles' => ['@'], |
|
178 | + 'actions' => [ 'index' ], |
|
179 | + 'roles' => [ '@' ], |
|
180 | 180 | ], |
181 | 181 | [ |
182 | 182 | 'allow' => true, |
183 | - 'actions' => ['show'], |
|
183 | + 'actions' => [ 'show' ], |
|
184 | 184 | // allow for all logged in users |
185 | 185 | #'roles' => ['@'], |
186 | 186 | // allow only if user has 'user' grant or requested his own profile (check by user->id) |
187 | - 'matchCallback' => function ($action) { |
|
187 | + 'matchCallback' => function($action) { |
|
188 | 188 | if (\Yii::$app->user->isGuest) { |
189 | 189 | return false; |
190 | 190 | } |
191 | 191 | if (\Yii::$app->user->can('user')) { |
192 | 192 | return true; |
193 | 193 | } |
194 | - if (\Yii::$app->user->id === (int)Yii::$app->request->getQueryParam('id')) { |
|
194 | + if (\Yii::$app->user->id === (int) Yii::$app->request->getQueryParam('id')) { |
|
195 | 195 | return true; |
196 | 196 | } |
197 | 197 | return false; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | 'converter' => [ |
213 | 213 | 'class' => 'yii\web\AssetConverter', |
214 | 214 | 'commands' => [ |
215 | - 'less' => ['css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map'], |
|
215 | + 'less' => [ 'css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map' ], |
|
216 | 216 | ], |
217 | 217 | ], |
218 | 218 | ], |
@@ -277,8 +277,8 @@ discard block |
||
277 | 277 | 'common' => [ |
278 | 278 | 'class' => Target::class, |
279 | 279 | 'url' => 'php://stderr', |
280 | - 'levels' => ['error', 'warning'], |
|
281 | - 'logVars' => [], |
|
280 | + 'levels' => [ 'error', 'warning' ], |
|
281 | + 'logVars' => [ ], |
|
282 | 282 | 'replaceNewline' => APP_TYPE === 'console' ? null : '' |
283 | 283 | ] |
284 | 284 | ] |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | 'transport' => [ |
291 | 291 | 'scheme' => getenv('APP_MAILER_SCHEME') ?: 'smtp', |
292 | 292 | 'host' => getenv('APP_MAILER_HOST'), |
293 | - 'port' => (int)getenv('APP_MAILER_PORT'), |
|
293 | + 'port' => (int) getenv('APP_MAILER_PORT'), |
|
294 | 294 | 'encryption' => getenv('APP_MAILER_ENCRYPTION'), |
295 | 295 | 'username' => getenv('APP_MAILER_USERNAME'), |
296 | 296 | 'password' => getenv('APP_MAILER_PASSWORD') |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | 'charset' => 'UTF-8', |
300 | 300 | 'replyTo' => getenv('APP_MAILER_REPLY_TO'), |
301 | 301 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
302 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
302 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
303 | 303 | ] |
304 | 304 | ], |
305 | 305 | 'queue' => [ |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | 'channel' => getenv('APP_QUEUE_CHANNEL'), |
308 | 308 | 'mutex' => 'queueMutex', |
309 | 309 | 'as log' => LogBehavior::class, |
310 | - 'on ' . Queue::EVENT_AFTER_ERROR => function (ExecEvent $event) { |
|
310 | + 'on '.Queue::EVENT_AFTER_ERROR => function(ExecEvent $event) { |
|
311 | 311 | if ($event->error instanceof Throwable) { |
312 | 312 | Yii::$app->getModule('audit')->exception($event->error); |
313 | 313 | } else { |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | 'user' => [ |
338 | 338 | 'class' => User::class, |
339 | 339 | 'enableAutoLogin' => true, |
340 | - 'loginUrl' => ['/user/security/login'], |
|
340 | + 'loginUrl' => [ '/user/security/login' ], |
|
341 | 341 | 'identityClass' => UserModel::class, |
342 | - 'rootUsers' => ['admin'] |
|
342 | + 'rootUsers' => [ 'admin' ] |
|
343 | 343 | ], |
344 | 344 | 'urlManager' => [ |
345 | 345 | 'class' => UrlManager::class, |
@@ -375,18 +375,18 @@ discard block |
||
375 | 375 | 'auto_reload' => true |
376 | 376 | ], |
377 | 377 | 'globals' => [ |
378 | - 'Html' => ['class' => Html::class], |
|
379 | - 'Json' => ['class' => Json::class], |
|
380 | - 'Tree' => ['class' => Tree::class], |
|
381 | - 'FA' => ['class' => FA::class], |
|
382 | - 'Url' => ['class' => Url::class], |
|
383 | - 'Markdown' => ['class' => Markdown::class] |
|
378 | + 'Html' => [ 'class' => Html::class ], |
|
379 | + 'Json' => [ 'class' => Json::class ], |
|
380 | + 'Tree' => [ 'class' => Tree::class ], |
|
381 | + 'FA' => [ 'class' => FA::class ], |
|
382 | + 'Url' => [ 'class' => Url::class ], |
|
383 | + 'Markdown' => [ 'class' => Markdown::class ] |
|
384 | 384 | ], |
385 | 385 | 'functions' => [ |
386 | - 'image' => function ($imageSource, $preset = '') { |
|
386 | + 'image' => function($imageSource, $preset = '') { |
|
387 | 387 | return ImageUrlHelper::image($imageSource, $preset); |
388 | 388 | }, |
389 | - 't' => function ($category, $message, $params = [], $language = null) { |
|
389 | + 't' => function($category, $message, $params = [ ], $language = null) { |
|
390 | 390 | return Yii::t($category, $message, $params, $language); |
391 | 391 | } |
392 | 392 | ], |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | 'modules' => [ |
401 | 401 | 'audit' => [ |
402 | 402 | 'class' => AuditModule::class, |
403 | - 'accessRoles' => ['audit-module'], |
|
403 | + 'accessRoles' => [ 'audit-module' ], |
|
404 | 404 | 'layout' => $boxLayout, |
405 | 405 | 'panels' => [ |
406 | 406 | 'audit/trail' => [ |
@@ -497,12 +497,12 @@ discard block |
||
497 | 497 | [ |
498 | 498 | 'connection' => 'db', |
499 | 499 | 'table' => '{{%hrzg_widget_template}}', |
500 | - 'columns' => ['twig_template'] |
|
500 | + 'columns' => [ 'twig_template' ] |
|
501 | 501 | ], |
502 | 502 | [ |
503 | 503 | 'connection' => 'db', |
504 | 504 | 'table' => '{{%twig}}', |
505 | - 'columns' => ['value'] |
|
505 | + 'columns' => [ 'value' ] |
|
506 | 506 | ] |
507 | 507 | ], |
508 | 508 | 'scanners' => [ |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | ScannerJavaScriptFunction::class, |
512 | 512 | ScannerDatabase::class |
513 | 513 | ], |
514 | - 'allowedIPs' => ['*'], |
|
515 | - 'roles' => ['translate-module'] |
|
514 | + 'allowedIPs' => [ '*' ], |
|
515 | + 'roles' => [ 'translate-module' ] |
|
516 | 516 | ], |
517 | 517 | 'user' => [ |
518 | 518 | 'class' => UserModule::class, |
@@ -520,12 +520,12 @@ discard block |
||
520 | 520 | 'enableGdprCompliance' => true, |
521 | 521 | 'defaultRoute' => 'admin', |
522 | 522 | 'administratorPermissionName' => 'user-module', |
523 | - 'administrators' => ['admin'], |
|
523 | + 'administrators' => [ 'admin' ], |
|
524 | 524 | 'enableFlashMessages' => false, |
525 | 525 | 'generatePasswords' => true, |
526 | 526 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
527 | 527 | 'mailParams' => [ |
528 | - 'fromEmail' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
528 | + 'fromEmail' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
529 | 529 | ], |
530 | 530 | ], |
531 | 531 | 'widgets' => [ |
@@ -540,16 +540,16 @@ discard block |
||
540 | 540 | ]; |
541 | 541 | |
542 | 542 | if ($s3Enabled) { |
543 | - $common['components']['fsS3'] = [ |
|
543 | + $common[ 'components' ][ 'fsS3' ] = [ |
|
544 | 544 | 'class' => AwsS3Filesystem::class, |
545 | 545 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
546 | 546 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
547 | 547 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
548 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
548 | + 'prefix' => getenv('APP_NAME').'/public', |
|
549 | 549 | 'region' => getenv('AMAZON_S3_BUCKET_REGION') |
550 | 550 | ]; |
551 | 551 | |
552 | - $common['modules']['filefly']['filesystemComponents']['s3'] = 'fsS3'; |
|
552 | + $common[ 'modules' ][ 'filefly' ][ 'filesystemComponents' ][ 's3' ] = 'fsS3'; |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | return $common; |