@@ -16,9 +16,9 @@ |
||
16 | 16 | // Codeception testing routes |
17 | 17 | if (YII_ENV_TEST && file_exists($rootPath . '/tests/c3.php')) { |
18 | 18 | define('C3_CODECOVERAGE_ERROR_LOG_FILE', |
19 | - getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
|
19 | + getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
|
20 | 20 | define('C3_CODECEPTION_CONFIG_PATH', |
21 | - getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
|
21 | + getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
|
22 | 22 | require_once $rootPath . '/tests/c3.php'; |
23 | 23 | } |
24 | 24 |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Prepare environment |
4 | -$rootPath = realpath(__DIR__ . '/..'); |
|
5 | -require($rootPath . '/vendor/autoload.php'); |
|
6 | -require($rootPath . '/config/env.php'); |
|
4 | +$rootPath = realpath(__DIR__.'/..'); |
|
5 | +require($rootPath.'/vendor/autoload.php'); |
|
6 | +require($rootPath.'/config/env.php'); |
|
7 | 7 | |
8 | 8 | // Define framework & application constants |
9 | -defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG')); |
|
9 | +defined('YII_DEBUG') or define('YII_DEBUG', (boolean) getenv('YII_DEBUG')); |
|
10 | 10 | defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV')); |
11 | 11 | defined('APP_TYPE') or define('APP_TYPE', 'web'); |
12 | 12 | |
13 | 13 | // Load framework |
14 | -require($rootPath . '/vendor/yiisoft/yii2/Yii.php'); |
|
14 | +require($rootPath.'/vendor/yiisoft/yii2/Yii.php'); |
|
15 | 15 | |
16 | 16 | // Codeception testing routes |
17 | -if (YII_ENV_TEST && file_exists($rootPath . '/tests/c3.php')) { |
|
17 | +if (YII_ENV_TEST && file_exists($rootPath.'/tests/c3.php')) { |
|
18 | 18 | define('C3_CODECOVERAGE_ERROR_LOG_FILE', |
19 | 19 | getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
20 | 20 | define('C3_CODECEPTION_CONFIG_PATH', |
21 | 21 | getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
22 | - require_once $rootPath . '/tests/c3.php'; |
|
22 | + require_once $rootPath.'/tests/c3.php'; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | // Run application |
26 | -(new yii\web\Application(require($rootPath . '/config/main.php')))->run(); |
|
26 | +(new yii\web\Application(require($rootPath.'/config/main.php')))->run(); |
@@ -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 | ]; |
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 | $boxLayout = '@backend/views/layouts/box'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | return [ |
106 | 106 | 'id' => 'app', |
107 | 107 | 'name' => getenv('APP_TITLE'), |
108 | - 'language' => $languages[0], |
|
108 | + 'language' => $languages[ 0 ], |
|
109 | 109 | 'basePath' => '@app', |
110 | 110 | 'vendorPath' => '@root/vendor', |
111 | 111 | 'runtimePath' => '@root/runtime', |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | ], |
124 | 124 | 'params' => [ |
125 | 125 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
126 | - 'context.menuItems' => [], |
|
126 | + 'context.menuItems' => [ ], |
|
127 | 127 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
128 | 128 | 'backend.browserSupport' => [ |
129 | 129 | 'Chrome' => 87, |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | 'container' => [ |
140 | 140 | 'definitions' => [ |
141 | 141 | AuthDbManagerComponent::class => [ |
142 | - 'defaultRoles' => ['Default'], |
|
142 | + 'defaultRoles' => [ 'Default' ], |
|
143 | 143 | 'cache' => 'cache' |
144 | 144 | ], |
145 | 145 | AdminController::class => [ |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | 'rules' => [ |
164 | 164 | [ |
165 | 165 | 'allow' => true, |
166 | - 'actions' => ['index'], |
|
167 | - 'roles' => ['@'], |
|
166 | + 'actions' => [ 'index' ], |
|
167 | + 'roles' => [ '@' ], |
|
168 | 168 | ], |
169 | 169 | [ |
170 | 170 | 'allow' => true, |
171 | - 'actions' => ['show'], |
|
171 | + 'actions' => [ 'show' ], |
|
172 | 172 | // allow for all logged in users |
173 | 173 | #'roles' => ['@'], |
174 | 174 | // allow only if user has 'user' grant or requested his own profile (check by user->id) |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | if (\Yii::$app->user->can('user')) { |
180 | 180 | return true; |
181 | 181 | } |
182 | - if (\Yii::$app->user->id === (int)Yii::$app->request->getQueryParam('id')) { |
|
182 | + if (\Yii::$app->user->id === (int) Yii::$app->request->getQueryParam('id')) { |
|
183 | 183 | return true; |
184 | 184 | } |
185 | 185 | return false; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'converter' => [ |
201 | 201 | 'class' => 'yii\web\AssetConverter', |
202 | 202 | 'commands' => [ |
203 | - 'less' => ['css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map'], |
|
203 | + 'less' => [ 'css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map' ], |
|
204 | 204 | ], |
205 | 205 | ], |
206 | 206 | ], |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
241 | 241 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
242 | 242 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
243 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
243 | + 'prefix' => getenv('APP_NAME').'/public', |
|
244 | 244 | 'region' => getenv('AMAZON_S3_BUCKET_REGION') |
245 | 245 | ], |
246 | 246 | 'fsRuntime' => [ |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | 'common' => [ |
288 | 288 | 'class' => Target::class, |
289 | 289 | 'url' => 'php://stderr', |
290 | - 'levels' => ['error', 'warning'], |
|
291 | - 'logVars' => [], |
|
290 | + 'levels' => [ 'error', 'warning' ], |
|
291 | + 'logVars' => [ ], |
|
292 | 292 | 'replaceNewline' => APP_TYPE === 'console' ? null : '' |
293 | 293 | ] |
294 | 294 | ] |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'transport' => [ |
301 | 301 | 'scheme' => getenv('APP_MAILER_SCHEME') ?: 'smtp', |
302 | 302 | 'host' => getenv('APP_MAILER_HOST'), |
303 | - 'port' => (int)getenv('APP_MAILER_PORT'), |
|
303 | + 'port' => (int) getenv('APP_MAILER_PORT'), |
|
304 | 304 | 'encryption' => getenv('APP_MAILER_ENCRYPTION'), |
305 | 305 | 'username' => getenv('APP_MAILER_USERNAME'), |
306 | 306 | 'password' => getenv('APP_MAILER_PASSWORD') |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | 'charset' => 'UTF-8', |
310 | 310 | 'replyTo' => getenv('APP_MAILER_REPLY_TO'), |
311 | 311 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
312 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
312 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
313 | 313 | ] |
314 | 314 | ], |
315 | 315 | 'queue' => [ |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | 'user' => [ |
337 | 337 | 'class' => User::class, |
338 | 338 | 'enableAutoLogin' => true, |
339 | - 'loginUrl' => ['/user/security/login'], |
|
339 | + 'loginUrl' => [ '/user/security/login' ], |
|
340 | 340 | 'identityClass' => UserModel::class, |
341 | - 'rootUsers' => ['admin'] |
|
341 | + 'rootUsers' => [ 'admin' ] |
|
342 | 342 | ], |
343 | 343 | 'urlManager' => [ |
344 | 344 | 'class' => UrlManager::class, |
@@ -373,18 +373,18 @@ discard block |
||
373 | 373 | 'auto_reload' => true |
374 | 374 | ], |
375 | 375 | 'globals' => [ |
376 | - 'Html' => ['class' => Html::class], |
|
377 | - 'Json' => ['class' => Json::class], |
|
378 | - 'Tree' => ['class' => Tree::class], |
|
379 | - 'FA' => ['class' => FA::class], |
|
380 | - 'Url' => ['class' => Url::class], |
|
381 | - 'Markdown' => ['class' => Markdown::class] |
|
376 | + 'Html' => [ 'class' => Html::class ], |
|
377 | + 'Json' => [ 'class' => Json::class ], |
|
378 | + 'Tree' => [ 'class' => Tree::class ], |
|
379 | + 'FA' => [ 'class' => FA::class ], |
|
380 | + 'Url' => [ 'class' => Url::class ], |
|
381 | + 'Markdown' => [ 'class' => Markdown::class ] |
|
382 | 382 | ], |
383 | 383 | 'functions' => [ |
384 | - 'image' => function ($imageSource, $preset = null) { |
|
384 | + 'image' => function($imageSource, $preset = null) { |
|
385 | 385 | return ImageUrlHelper::image($imageSource, $preset); |
386 | 386 | }, |
387 | - 't' => function ($category, $message, $params = [], $language = null) { |
|
387 | + 't' => function($category, $message, $params = [ ], $language = null) { |
|
388 | 388 | return Yii::t($category, $message, $params, $language); |
389 | 389 | } |
390 | 390 | ], |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | 'modules' => [ |
399 | 399 | 'audit' => [ |
400 | 400 | 'class' => AuditModule::class, |
401 | - 'accessRoles' => ['audit-module'], |
|
401 | + 'accessRoles' => [ 'audit-module' ], |
|
402 | 402 | 'layout' => $boxLayout, |
403 | 403 | 'panels' => [ |
404 | 404 | 'audit/trail' => [ |
@@ -500,12 +500,12 @@ discard block |
||
500 | 500 | [ |
501 | 501 | 'connection' => 'db', |
502 | 502 | 'table' => '{{%hrzg_widget_template}}', |
503 | - 'columns' => ['twig_template'] |
|
503 | + 'columns' => [ 'twig_template' ] |
|
504 | 504 | ], |
505 | 505 | [ |
506 | 506 | 'connection' => 'db', |
507 | 507 | 'table' => '{{%twig}}', |
508 | - 'columns' => ['value'] |
|
508 | + 'columns' => [ 'value' ] |
|
509 | 509 | ] |
510 | 510 | ], |
511 | 511 | 'scanners' => [ |
@@ -514,8 +514,8 @@ discard block |
||
514 | 514 | ScannerJavaScriptFunction::class, |
515 | 515 | ScannerDatabase::class |
516 | 516 | ], |
517 | - 'allowedIPs' => ['*'], |
|
518 | - 'roles' => ['translate-module'] |
|
517 | + 'allowedIPs' => [ '*' ], |
|
518 | + 'roles' => [ 'translate-module' ] |
|
519 | 519 | ], |
520 | 520 | 'user' => [ |
521 | 521 | 'class' => UserModule::class, |
@@ -523,12 +523,12 @@ discard block |
||
523 | 523 | 'enableGdprCompliance' => true, |
524 | 524 | 'defaultRoute' => 'admin', |
525 | 525 | 'administratorPermissionName' => 'user-module', |
526 | - 'administrators' => ['admin'], |
|
526 | + 'administrators' => [ 'admin' ], |
|
527 | 527 | 'enableFlashMessages' => false, |
528 | 528 | 'generatePasswords' => true, |
529 | 529 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
530 | 530 | 'mailParams' => [ |
531 | - 'fromEmail' => [getenv('APP_MAILER_FROM')=>getenv('APP_TITLE')] |
|
531 | + 'fromEmail' => [ getenv('APP_MAILER_FROM')=>getenv('APP_TITLE') ] |
|
532 | 532 | ], |
533 | 533 | ], |
534 | 534 | 'widgets' => [ |