@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 80 | 80 | |
| 81 | 81 | // prepare asset bundle config |
| 82 | -$bundles = []; |
|
| 82 | +$bundles = [ ]; |
|
| 83 | 83 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 84 | 84 | // include generated asset-bundle configuration |
| 85 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
| 85 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
| 86 | 86 | // disable loading of bundles skin file, when using bundled assets |
| 87 | 87 | Yii::$container->set( |
| 88 | 88 | AdminLteAsset::class, |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => 0 |
| 100 | 100 | ]; |
| 101 | 101 | if (getenv('MYSQL_ATTR_SSL_CA')) { |
| 102 | - $dbAttributes[PDO::MYSQL_ATTR_SSL_CA] = getenv('MYSQL_ATTR_SSL_CA'); |
|
| 102 | + $dbAttributes[ PDO::MYSQL_ATTR_SSL_CA ] = getenv('MYSQL_ATTR_SSL_CA'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // Enable S3 component, if ENVs are set (BC) |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $common = [ |
| 121 | 121 | 'id' => 'app', |
| 122 | 122 | 'name' => getenv('APP_TITLE'), |
| 123 | - 'language' => $languages[0], |
|
| 123 | + 'language' => $languages[ 0 ], |
|
| 124 | 124 | 'basePath' => '@app', |
| 125 | 125 | 'vendorPath' => '@root/vendor', |
| 126 | 126 | 'runtimePath' => '@root/runtime', |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ], |
| 139 | 139 | 'params' => [ |
| 140 | 140 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 141 | - 'context.menuItems' => [], |
|
| 141 | + 'context.menuItems' => [ ], |
|
| 142 | 142 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
| 143 | 143 | 'backend.browserSupport' => [ |
| 144 | 144 | 'Chrome' => 87, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | 'container' => [ |
| 155 | 155 | 'definitions' => [ |
| 156 | 156 | AuthDbManagerComponent::class => [ |
| 157 | - 'defaultRoles' => ['Default'], |
|
| 157 | + 'defaultRoles' => [ 'Default' ], |
|
| 158 | 158 | 'cache' => 'cache' |
| 159 | 159 | ], |
| 160 | 160 | AdminController::class => [ |
@@ -178,23 +178,23 @@ discard block |
||
| 178 | 178 | 'rules' => [ |
| 179 | 179 | [ |
| 180 | 180 | 'allow' => true, |
| 181 | - 'actions' => ['index'], |
|
| 182 | - 'roles' => ['@'], |
|
| 181 | + 'actions' => [ 'index' ], |
|
| 182 | + 'roles' => [ '@' ], |
|
| 183 | 183 | ], |
| 184 | 184 | [ |
| 185 | 185 | 'allow' => true, |
| 186 | - 'actions' => ['show'], |
|
| 186 | + 'actions' => [ 'show' ], |
|
| 187 | 187 | // allow for all logged in users |
| 188 | 188 | #'roles' => ['@'], |
| 189 | 189 | // allow only if user has 'user' grant or requested his own profile (check by user->id) |
| 190 | - 'matchCallback' => function ($action) { |
|
| 190 | + 'matchCallback' => function($action) { |
|
| 191 | 191 | if (\Yii::$app->user->isGuest) { |
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | if (\Yii::$app->user->can('user')) { |
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | - if (\Yii::$app->user->id === (int)Yii::$app->request->getQueryParam('id')) { |
|
| 197 | + if (\Yii::$app->user->id === (int) Yii::$app->request->getQueryParam('id')) { |
|
| 198 | 198 | return true; |
| 199 | 199 | } |
| 200 | 200 | return false; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | 'converter' => [ |
| 216 | 216 | 'class' => 'yii\web\AssetConverter', |
| 217 | 217 | 'commands' => [ |
| 218 | - 'less' => ['css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map'], |
|
| 218 | + 'less' => [ 'css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map' ], |
|
| 219 | 219 | ], |
| 220 | 220 | ], |
| 221 | 221 | ], |
@@ -280,8 +280,8 @@ discard block |
||
| 280 | 280 | 'common' => [ |
| 281 | 281 | 'class' => Target::class, |
| 282 | 282 | 'url' => 'php://stderr', |
| 283 | - 'levels' => ['error', 'warning'], |
|
| 284 | - 'logVars' => [], |
|
| 283 | + 'levels' => [ 'error', 'warning' ], |
|
| 284 | + 'logVars' => [ ], |
|
| 285 | 285 | 'replaceNewline' => APP_TYPE === 'console' ? null : '' |
| 286 | 286 | ] |
| 287 | 287 | ] |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | 'transport' => [ |
| 294 | 294 | 'scheme' => getenv('APP_MAILER_SCHEME') ?: 'smtp', |
| 295 | 295 | 'host' => getenv('APP_MAILER_HOST'), |
| 296 | - 'port' => (int)getenv('APP_MAILER_PORT'), |
|
| 296 | + 'port' => (int) getenv('APP_MAILER_PORT'), |
|
| 297 | 297 | 'encryption' => getenv('APP_MAILER_ENCRYPTION'), |
| 298 | 298 | 'username' => getenv('APP_MAILER_USERNAME'), |
| 299 | 299 | 'password' => getenv('APP_MAILER_PASSWORD') |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | 'charset' => 'UTF-8', |
| 303 | 303 | 'replyTo' => getenv('APP_MAILER_REPLY_TO'), |
| 304 | 304 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
| 305 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
| 305 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
| 306 | 306 | ] |
| 307 | 307 | ], |
| 308 | 308 | 'queue' => [ |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | 'mutex' => 'queueMutex', |
| 312 | 312 | 'as log' => LogBehavior::class, |
| 313 | 313 | 'as queuemanager' => QueueManagerBehavior::class, |
| 314 | - 'on ' . Queue::EVENT_AFTER_ERROR => function (ExecEvent $event) { |
|
| 314 | + 'on '.Queue::EVENT_AFTER_ERROR => function(ExecEvent $event) { |
|
| 315 | 315 | if ($event->error instanceof Throwable) { |
| 316 | 316 | Yii::$app->getModule('audit')->exception($event->error); |
| 317 | 317 | } else { |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | 'user' => [ |
| 342 | 342 | 'class' => User::class, |
| 343 | 343 | 'enableAutoLogin' => true, |
| 344 | - 'loginUrl' => ['/user/security/login'], |
|
| 344 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 345 | 345 | 'identityClass' => UserModel::class, |
| 346 | - 'rootUsers' => ['admin'] |
|
| 346 | + 'rootUsers' => [ 'admin' ] |
|
| 347 | 347 | ], |
| 348 | 348 | 'urlManager' => [ |
| 349 | 349 | 'class' => UrlManager::class, |
@@ -379,18 +379,18 @@ discard block |
||
| 379 | 379 | 'auto_reload' => true |
| 380 | 380 | ], |
| 381 | 381 | 'globals' => [ |
| 382 | - 'Html' => ['class' => Html::class], |
|
| 383 | - 'Json' => ['class' => Json::class], |
|
| 384 | - 'Tree' => ['class' => Tree::class], |
|
| 385 | - 'FA' => ['class' => FA::class], |
|
| 386 | - 'Url' => ['class' => Url::class], |
|
| 387 | - 'Markdown' => ['class' => Markdown::class] |
|
| 382 | + 'Html' => [ 'class' => Html::class ], |
|
| 383 | + 'Json' => [ 'class' => Json::class ], |
|
| 384 | + 'Tree' => [ 'class' => Tree::class ], |
|
| 385 | + 'FA' => [ 'class' => FA::class ], |
|
| 386 | + 'Url' => [ 'class' => Url::class ], |
|
| 387 | + 'Markdown' => [ 'class' => Markdown::class ] |
|
| 388 | 388 | ], |
| 389 | 389 | 'functions' => [ |
| 390 | - 'image' => function ($imageSource, $preset = '') { |
|
| 390 | + 'image' => function($imageSource, $preset = '') { |
|
| 391 | 391 | return ImageUrlHelper::image($imageSource, $preset); |
| 392 | 392 | }, |
| 393 | - 't' => function ($category, $message, $params = [], $language = null) { |
|
| 393 | + 't' => function($category, $message, $params = [ ], $language = null) { |
|
| 394 | 394 | return Yii::t($category, $message, $params, $language); |
| 395 | 395 | } |
| 396 | 396 | ], |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | 'modules' => [ |
| 405 | 405 | 'audit' => [ |
| 406 | 406 | 'class' => AuditModule::class, |
| 407 | - 'accessRoles' => ['audit-module'], |
|
| 407 | + 'accessRoles' => [ 'audit-module' ], |
|
| 408 | 408 | 'layout' => $boxLayout, |
| 409 | 409 | 'panels' => [ |
| 410 | 410 | 'audit/trail' => [ |
@@ -506,12 +506,12 @@ discard block |
||
| 506 | 506 | [ |
| 507 | 507 | 'connection' => 'db', |
| 508 | 508 | 'table' => '{{%hrzg_widget_template}}', |
| 509 | - 'columns' => ['twig_template'] |
|
| 509 | + 'columns' => [ 'twig_template' ] |
|
| 510 | 510 | ], |
| 511 | 511 | [ |
| 512 | 512 | 'connection' => 'db', |
| 513 | 513 | 'table' => '{{%twig}}', |
| 514 | - 'columns' => ['value'] |
|
| 514 | + 'columns' => [ 'value' ] |
|
| 515 | 515 | ] |
| 516 | 516 | ], |
| 517 | 517 | 'scanners' => [ |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | ScannerJavaScriptFunction::class, |
| 521 | 521 | ScannerDatabase::class |
| 522 | 522 | ], |
| 523 | - 'allowedIPs' => ['*'], |
|
| 524 | - 'roles' => ['translate-module'] |
|
| 523 | + 'allowedIPs' => [ '*' ], |
|
| 524 | + 'roles' => [ 'translate-module' ] |
|
| 525 | 525 | ], |
| 526 | 526 | 'user' => [ |
| 527 | 527 | 'class' => UserModule::class, |
@@ -529,12 +529,12 @@ discard block |
||
| 529 | 529 | 'enableGdprCompliance' => true, |
| 530 | 530 | 'defaultRoute' => 'admin', |
| 531 | 531 | 'administratorPermissionName' => 'user-module', |
| 532 | - 'administrators' => ['admin'], |
|
| 532 | + 'administrators' => [ 'admin' ], |
|
| 533 | 533 | 'enableFlashMessages' => false, |
| 534 | 534 | 'generatePasswords' => true, |
| 535 | 535 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
| 536 | 536 | 'mailParams' => [ |
| 537 | - 'fromEmail' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
| 537 | + 'fromEmail' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
| 538 | 538 | ], |
| 539 | 539 | ], |
| 540 | 540 | 'widgets' => [ |
@@ -549,16 +549,16 @@ discard block |
||
| 549 | 549 | ]; |
| 550 | 550 | |
| 551 | 551 | if ($s3Enabled) { |
| 552 | - $common['components']['fsS3'] = [ |
|
| 552 | + $common[ 'components' ][ 'fsS3' ] = [ |
|
| 553 | 553 | 'class' => AwsS3Filesystem::class, |
| 554 | 554 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
| 555 | 555 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
| 556 | 556 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
| 557 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
| 557 | + 'prefix' => getenv('APP_NAME').'/public', |
|
| 558 | 558 | 'region' => getenv('AMAZON_S3_BUCKET_REGION') |
| 559 | 559 | ]; |
| 560 | 560 | |
| 561 | - $common['modules']['filefly']['filesystemComponents']['s3'] = 'fsS3'; |
|
| 561 | + $common[ 'modules' ][ 'filefly' ][ 'filesystemComponents' ][ 's3' ] = 'fsS3'; |
|
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | return $common; |