@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | { |
33 | 33 | switch ($actionID) { |
34 | 34 | case 'config': |
35 | - $additionalOptions = ['level']; |
|
35 | + $additionalOptions = [ 'level' ]; |
|
36 | 36 | break; |
37 | 37 | default: |
38 | - $additionalOptions = []; |
|
38 | + $additionalOptions = [ ]; |
|
39 | 39 | } |
40 | 40 | return ArrayHelper::merge( |
41 | 41 | $additionalOptions, |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | public function actionConfig($key = null) |
66 | 66 | { |
67 | 67 | // get config from global variable (TODO) |
68 | - $data = $GLOBALS['config']; |
|
68 | + $data = $GLOBALS[ 'config' ]; |
|
69 | 69 | if ($key) { |
70 | 70 | $keys = explode('.', $key); |
71 | - if (isset($keys[0])) { |
|
72 | - $data = $GLOBALS['config'][$keys[0]]; |
|
71 | + if (isset($keys[ 0 ])) { |
|
72 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ]; |
|
73 | 73 | } |
74 | - if (isset($keys[1])) { |
|
75 | - $data = $GLOBALS['config'][$keys[0]][$keys[1]]; |
|
74 | + if (isset($keys[ 1 ])) { |
|
75 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ][ $keys[ 1 ] ]; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | $this->stdout(VarDumper::dumpAsString($data, $this->level)); |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | public function actionVersion() |
95 | 95 | { |
96 | 96 | $this->stdout('Application Version: '); |
97 | - $this->stdout(getenv('APP_NAME') . ' '); |
|
98 | - $this->stdout(APP_VERSION . "\n"); |
|
97 | + $this->stdout(getenv('APP_NAME').' '); |
|
98 | + $this->stdout(APP_VERSION."\n"); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $this->stdout("=====================\n"); |
109 | 109 | $this->stdout("Initializing application\n"); |
110 | 110 | |
111 | - $this->interactive = (bool)getenv('APP_INTERACTIVE'); |
|
111 | + $this->interactive = (bool) getenv('APP_INTERACTIVE'); |
|
112 | 112 | |
113 | 113 | $this->stdout("\nDatabase\n"); |
114 | 114 | $this->stdout("--------\n"); |
115 | - $this->run('db/create', [getenv('DB_ENV_MYSQL_ROOT_USER'),getenv('DB_ENV_MYSQL_ROOT_PASSWORD')]); |
|
116 | - $this->run('migrate/up', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
115 | + $this->run('db/create', [ getenv('DB_ENV_MYSQL_ROOT_USER'), getenv('DB_ENV_MYSQL_ROOT_PASSWORD') ]); |
|
116 | + $this->run('migrate/up', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
117 | 117 | |
118 | 118 | $this->stdout("\nUser\n"); |
119 | 119 | $this->stdout("----\n"); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | 'default' => getenv('APP_ADMIN_PASSWORD') ?: Yii::$app->security->generateRandomString(8), |
124 | 124 | ] |
125 | 125 | ); |
126 | - $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]); |
|
126 | + $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]); |
|
127 | 127 | |
128 | 128 | $this->stdout('Initializing modules'); |
129 | 129 | |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | $this->stdout("\nCleanup\n"); |
139 | 139 | $this->stdout("-------\n"); |
140 | 140 | $this->run('cache/flush-all'); |
141 | - $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
142 | - $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
141 | + $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
142 | + $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -153,20 +153,20 @@ discard block |
||
153 | 153 | $matchRegex = '"^[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]\?[a-z0-9]$"'; |
154 | 154 | |
155 | 155 | // create $cmd command |
156 | - $cmd = 'cd "' . $assets . '" && ls | grep -e ' . $matchRegex . ' | xargs rm -rf '; |
|
156 | + $cmd = 'cd "'.$assets.'" && ls | grep -e '.$matchRegex.' | xargs rm -rf '; |
|
157 | 157 | |
158 | 158 | // Set command |
159 | 159 | $command = new Command($cmd); |
160 | 160 | |
161 | 161 | // Prompt user |
162 | - $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); |
|
162 | + $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); |
|
163 | 163 | |
164 | 164 | if ($delete) { |
165 | 165 | // Try to execute $command |
166 | 166 | if ($command->execute()) { |
167 | 167 | $this->stdout("Web assets have been deleted.\n\n"); |
168 | 168 | } else { |
169 | - $this->stderr("\n" . $command->getError() . "\n"); |
|
169 | + $this->stderr("\n".$command->getError()."\n"); |
|
170 | 170 | $this->stderr($command->getStdErr()); |
171 | 171 | } |
172 | 172 | } |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | $message = $mailer->compose(); |
180 | 180 | $message |
181 | 181 | ->setTo($to) |
182 | - ->setSubject('Test-Mail from ' . getenv('APP_NAME')) |
|
183 | - ->setTextBody(getenv('APP_TITLE') . ' | ' . getenv('HOSTNAME')); |
|
182 | + ->setSubject('Test-Mail from '.getenv('APP_NAME')) |
|
183 | + ->setTextBody(getenv('APP_TITLE').' | '.getenv('HOSTNAME')); |
|
184 | 184 | |
185 | 185 | if ($message->send()) { |
186 | 186 | $this->stdout('Mail sent'); |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -echo json_encode(['status.webserver'=>'OK','status.appserver'=>'OK']); |
|
3 | +echo json_encode([ 'status.webserver'=>'OK', 'status.appserver'=>'OK' ]); |
@@ -91,7 +91,7 @@ |
||
91 | 91 | 'converter' => [ |
92 | 92 | 'class' => 'yii\web\AssetConverter', |
93 | 93 | 'commands' => [ |
94 | - 'less' => ['css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map'], |
|
94 | + 'less' => [ 'css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map' ], |
|
95 | 95 | ], |
96 | 96 | ], |
97 | 97 | ], |
@@ -16,22 +16,22 @@ discard block |
||
16 | 16 | 'db' => [ |
17 | 17 | 'class' => \dmstr\console\controllers\MysqlController::class, |
18 | 18 | 'excludeTables' => [ |
19 | - getenv('DATABASE_TABLE_PREFIX') . 'auth_assignment', |
|
20 | - getenv('DATABASE_TABLE_PREFIX') . 'migration', |
|
21 | - getenv('DATABASE_TABLE_PREFIX') . 'user', |
|
22 | - getenv('DATABASE_TABLE_PREFIX') . 'profile', |
|
23 | - getenv('DATABASE_TABLE_PREFIX') . 'token', |
|
24 | - getenv('DATABASE_TABLE_PREFIX') . 'social_account', |
|
25 | - getenv('DATABASE_TABLE_PREFIX') . 'log', |
|
26 | - getenv('DATABASE_TABLE_PREFIX') . 'session', |
|
27 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_data', |
|
28 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_entry', |
|
29 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_error', |
|
30 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_javascript', |
|
31 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_mail', |
|
32 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_trail', |
|
33 | - getenv('DATABASE_TABLE_PREFIX') . 'dmstr_contact_log', |
|
34 | - getenv('DATABASE_TABLE_PREFIX') . 'queue_manager', |
|
19 | + getenv('DATABASE_TABLE_PREFIX').'auth_assignment', |
|
20 | + getenv('DATABASE_TABLE_PREFIX').'migration', |
|
21 | + getenv('DATABASE_TABLE_PREFIX').'user', |
|
22 | + getenv('DATABASE_TABLE_PREFIX').'profile', |
|
23 | + getenv('DATABASE_TABLE_PREFIX').'token', |
|
24 | + getenv('DATABASE_TABLE_PREFIX').'social_account', |
|
25 | + getenv('DATABASE_TABLE_PREFIX').'log', |
|
26 | + getenv('DATABASE_TABLE_PREFIX').'session', |
|
27 | + getenv('DATABASE_TABLE_PREFIX').'audit_data', |
|
28 | + getenv('DATABASE_TABLE_PREFIX').'audit_entry', |
|
29 | + getenv('DATABASE_TABLE_PREFIX').'audit_error', |
|
30 | + getenv('DATABASE_TABLE_PREFIX').'audit_javascript', |
|
31 | + getenv('DATABASE_TABLE_PREFIX').'audit_mail', |
|
32 | + getenv('DATABASE_TABLE_PREFIX').'audit_trail', |
|
33 | + getenv('DATABASE_TABLE_PREFIX').'dmstr_contact_log', |
|
34 | + getenv('DATABASE_TABLE_PREFIX').'queue_manager', |
|
35 | 35 | 'filefly_hashmap', # TODO: fix prefix in module |
36 | 36 | ], |
37 | 37 | ], |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'class' => \yii\log\FileTarget::class, |
77 | 77 | 'logFile' => '@runtime/logs/console.log', |
78 | 78 | //'levels' => ['info', 'trace'], |
79 | - 'logVars' => [], |
|
79 | + 'logVars' => [ ], |
|
80 | 80 | 'dirMode' => YII_ENV_DEV ? 0777 : 0775, |
81 | 81 | 'fileMode' => YII_ENV_DEV ? 0666 : null, |
82 | 82 | 'enabled' => YII_DEBUG && !YII_ENV_TEST, |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | ], |
85 | 85 | ], |
86 | 86 | 'dbSystem' => [ |
87 | - 'on ' . yii\db\Connection::EVENT_AFTER_OPEN => function ($event) { |
|
87 | + 'on '.yii\db\Connection::EVENT_AFTER_OPEN => function($event) { |
|
88 | 88 | if ($event->sender->driverName === 'mysql') { |
89 | 89 | // set session wait_timeout for this connection to mysql default value to prevent connection-timeouts |
90 | 90 | // in e.g. audit module while exec long-running CLI processes |
91 | 91 | $event->sender->createCommand( |
92 | 92 | 'SET SESSION wait_timeout = :timeout;', |
93 | 93 | [ |
94 | - ':timeout' => (int)getenv('DB_ENV_MYSQL_CLI_WAIT_TIMEOUT') ?: 28800 |
|
94 | + ':timeout' => (int) getenv('DB_ENV_MYSQL_CLI_WAIT_TIMEOUT') ?: 28800 |
|
95 | 95 | ] |
96 | 96 | )->execute(); |
97 | 97 | } |
@@ -1,37 +1,37 @@ |
||
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 | // Enable YII_DEBUG by key/token cookie |
9 | 9 | if (strlen(getenv('APP_DEBUG_KEY') > 10) && |
10 | 10 | strlen(getenv('APP_DEBUG_TOKEN') > 10)) { |
11 | - if (isset($_COOKIE[getenv('APP_DEBUG_KEY')]) && |
|
12 | - ($_COOKIE[getenv('APP_DEBUG_KEY')] === getenv('APP_DEBUG_TOKEN'))) { |
|
11 | + if (isset($_COOKIE[ getenv('APP_DEBUG_KEY') ]) && |
|
12 | + ($_COOKIE[ getenv('APP_DEBUG_KEY') ] === getenv('APP_DEBUG_TOKEN'))) { |
|
13 | 13 | putenv('YII_DEBUG=1'); |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | 17 | // Define framework & application constants |
18 | -defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG')); |
|
18 | +defined('YII_DEBUG') or define('YII_DEBUG', (boolean) getenv('YII_DEBUG')); |
|
19 | 19 | defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV')); |
20 | 20 | defined('APP_TYPE') or define('APP_TYPE', 'web'); |
21 | 21 | |
22 | 22 | // Load framework |
23 | -require($rootPath . '/vendor/yiisoft/yii2/Yii.php'); |
|
23 | +require($rootPath.'/vendor/yiisoft/yii2/Yii.php'); |
|
24 | 24 | |
25 | 25 | // Codeception testing routes |
26 | -if (YII_ENV_TEST && file_exists($rootPath . '/tests/c3.php')) { |
|
26 | +if (YII_ENV_TEST && file_exists($rootPath.'/tests/c3.php')) { |
|
27 | 27 | define( |
28 | 28 | 'C3_CODECOVERAGE_ERROR_LOG_FILE', |
29 | 29 | getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
30 | 30 | define( |
31 | 31 | 'C3_CODECEPTION_CONFIG_PATH', |
32 | 32 | getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
33 | - require_once $rootPath . '/tests/c3.php'; |
|
33 | + require_once $rootPath.'/tests/c3.php'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Run application |
37 | -(new yii\web\Application(require($rootPath . '/config/main.php')))->run(); |
|
37 | +(new yii\web\Application(require($rootPath.'/config/main.php')))->run(); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | use Yii; |
15 | 15 | |
16 | 16 | // PHP Constants |
17 | -$version = is_file(__DIR__ . '/../src/version') ? trim(file_get_contents(__DIR__ . '/../src/version')) : 'dev'; |
|
17 | +$version = is_file(__DIR__.'/../src/version') ? trim(file_get_contents(__DIR__.'/../src/version')) : 'dev'; |
|
18 | 18 | defined('APP_VERSION') or define('APP_VERSION', $version); |
19 | 19 | $projectVersion = is_file(__DIR__.'/../project/version') ? trim(file_get_contents(__DIR__.'/../project/version')) : 'vanilla'; |
20 | 20 | defined('PROJECT_VERSION') or define('PROJECT_VERSION', $projectVersion); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | Yii::setAlias('@webroot', '@root/web'); |
28 | 28 | |
29 | 29 | // Use a closure to not pollute the global namespace |
30 | -return call_user_func(function () { |
|
30 | +return call_user_func(function() { |
|
31 | 31 | |
32 | 32 | /*function checkFile(){ |
33 | 33 | if (file_exists($file)) { |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | "{$configDir}/".APP_TYPE.'.php' => true, |
42 | 42 | "{$configDir}/common-".YII_ENV.'.php' => false, |
43 | 43 | "{$configDir}/".APP_TYPE.'-'.YII_ENV.'.php' => false, |
44 | - "{$configDir}/common-".((YII_DEBUG)?'debug':'release').'.php' => false, |
|
45 | - "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false, |
|
44 | + "{$configDir}/common-".((YII_DEBUG) ? 'debug' : 'release').'.php' => false, |
|
45 | + "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG) ? 'debug' : 'release').'.php' => false, |
|
46 | 46 | ]; |
47 | 47 | |
48 | 48 | if (!empty(getenv('APP_CONFIG_FILE'))) { |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | // Merge additional configurations |
51 | 51 | foreach ($additionalConfigFiles as $alias) { |
52 | 52 | $file = Yii::getAlias($alias); |
53 | - $configFiles[$file] = true; |
|
53 | + $configFiles[ $file ] = true; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | // Merge configurations |
58 | - $config = []; |
|
58 | + $config = [ ]; |
|
59 | 59 | Yii::trace($configFiles, __METHOD__); |
60 | 60 | foreach ($configFiles as $file => $isRequired) { |
61 | 61 | if (!is_file($file)) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'view' => [ |
17 | 17 | 'renderers' => [ |
18 | 18 | 'twig' => [ |
19 | - 'extensions' => (getenv('TWIG_DEBUG_MODE')) ? [new \Twig\Extension\DebugExtension()] : null, |
|
19 | + 'extensions' => (getenv('TWIG_DEBUG_MODE')) ? [ new \Twig\Extension\DebugExtension() ] : null, |
|
20 | 20 | 'options' => [ |
21 | 21 | 'debug' => (getenv('TWIG_DEBUG_MODE')) ? true : false, |
22 | 22 | ], |
@@ -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; |