@@ -13,7 +13,7 @@ |
||
13 | 13 | public function safeUp() |
14 | 14 | { |
15 | 15 | $table = $this->db->schema->getTableSchema('{{%migration}}'); |
16 | - if (isset($table->columns['alias'])) { |
|
16 | + if (isset($table->columns[ 'alias' ])) { |
|
17 | 17 | // Column exists |
18 | 18 | $this->alterColumn('{{%migration}}', 'alias', 'varchar(180) DEFAULT NULL'); |
19 | 19 | } |
@@ -32,13 +32,13 @@ |
||
32 | 32 | $dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]); |
33 | 33 | $dotenv->required('YII_ENV', ['dev', 'prod', 'test']); |
34 | 34 | $dotenv->required([ |
35 | - 'YII_TRACE_LEVEL', |
|
36 | - 'APP_NAME', |
|
37 | - 'APP_TITLE', |
|
38 | - 'APP_ADMIN_EMAIL', |
|
39 | - 'APP_LANGUAGES', |
|
40 | - 'APP_COOKIE_VALIDATION_KEY', |
|
41 | - ])->notEmpty(); |
|
35 | + 'YII_TRACE_LEVEL', |
|
36 | + 'APP_NAME', |
|
37 | + 'APP_TITLE', |
|
38 | + 'APP_ADMIN_EMAIL', |
|
39 | + 'APP_LANGUAGES', |
|
40 | + 'APP_COOKIE_VALIDATION_KEY', |
|
41 | + ])->notEmpty(); |
|
42 | 42 | |
43 | 43 | // Additional validations |
44 | 44 | if (!preg_match('/^[a-z0-9_-]{2,16}$/', getenv('APP_NAME'))) { |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | |
16 | 16 | // Load default settings via dotenv from file, load local environment first, if available |
17 | 17 | if (getenv('ENV_LOCAL_FILE')) { |
18 | - $localEnv = FileHelper::normalizePath($configPath . '/' . getenv('ENV_LOCAL_FILE')); |
|
18 | + $localEnv = FileHelper::normalizePath($configPath.'/'.getenv('ENV_LOCAL_FILE')); |
|
19 | 19 | if (is_file($localEnv)) { |
20 | 20 | $dotenvLocal = new Dotenv\Dotenv($configPath, getenv('ENV_LOCAL_FILE')); |
21 | 21 | $dotenvLocal->load(); |
22 | 22 | } else { |
23 | - exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found" . PHP_EOL); |
|
23 | + exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found".PHP_EOL); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $dotenv->load(); |
30 | 30 | |
31 | 31 | // Basic checks & validation |
32 | -$dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]); |
|
33 | -$dotenv->required('YII_ENV', ['dev', 'prod', 'test']); |
|
32 | +$dotenv->required('YII_DEBUG', [ '', '0', '1', 'true', true ]); |
|
33 | +$dotenv->required('YII_ENV', [ 'dev', 'prod', 'test' ]); |
|
34 | 34 | $dotenv->required([ |
35 | 35 | 'YII_TRACE_LEVEL', |
36 | 36 | 'APP_NAME', |
@@ -65,20 +65,20 @@ |
||
65 | 65 | <?php $this->beginBody() ?> |
66 | 66 | |
67 | 67 | <?php Pjax::begin([ |
68 | - 'id' => 'main-content', |
|
69 | - 'timeout' => 5000, |
|
70 | - 'linkSelector' => '.frontend-reload', |
|
71 | - ]) ?> |
|
68 | + 'id' => 'main-content', |
|
69 | + 'timeout' => 5000, |
|
70 | + 'linkSelector' => '.frontend-reload', |
|
71 | + ]) ?> |
|
72 | 72 | |
73 | 73 | <?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
74 | 74 | |
75 | 75 | <!-- Navbar --> |
76 | 76 | <?php |
77 | 77 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
78 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
79 | - } else { |
|
80 | - echo $this->render('_navbar'); |
|
81 | - } |
|
78 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
79 | + } else { |
|
80 | + echo $this->render('_navbar'); |
|
81 | + } |
|
82 | 82 | |
83 | 83 | ?> |
84 | 84 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | /* @var $this \yii\web\View */ |
24 | 24 | /* @var $content string */ |
25 | 25 | |
26 | -$this->title .= ' - ' . getenv('APP_TITLE'); |
|
27 | -$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '') . $this->title; |
|
26 | +$this->title .= ' - '.getenv('APP_TITLE'); |
|
27 | +$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '').$this->title; |
|
28 | 28 | |
29 | 29 | SettingsAsset::register($this); |
30 | 30 | |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | \yii\base\Event::on( |
33 | 33 | \yii\web\View::className(), |
34 | 34 | \yii\web\View::EVENT_AFTER_RENDER, |
35 | - function ($e) { |
|
35 | + function($e) { |
|
36 | 36 | // disable unbundled asset |
37 | - $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null; |
|
37 | + $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null; |
|
38 | 38 | // disable bundled asset |
39 | - $e->sender->assetBundles['bootstrap'] = null; |
|
39 | + $e->sender->assetBundles[ 'bootstrap' ] = null; |
|
40 | 40 | } |
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | 44 | // Favicon |
45 | 45 | if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets', null)) { |
46 | - $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]); |
|
46 | + $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | ?> |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | 'linkSelector' => '.frontend-reload', |
71 | 71 | ]) ?> |
72 | 72 | |
73 | -<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
|
73 | +<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?> |
|
74 | 74 | |
75 | 75 | <!-- Navbar --> |
76 | 76 | <?php |
77 | 77 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
78 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
78 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'key' => '_navbar' ]); |
|
79 | 79 | } else { |
80 | 80 | echo $this->render('_navbar'); |
81 | 81 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | <!-- Footer --> |
93 | 93 | <footer class="footer"> |
94 | - <?= Cell::widget(['id' => '_footer', 'requestParam' => '_global']) ?> |
|
94 | + <?= Cell::widget([ 'id' => '_footer', 'requestParam' => '_global' ]) ?> |
|
95 | 95 | </footer> |
96 | 96 | |
97 | 97 | <?php Pjax::end() ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ], |
107 | 107 | ]) ?> |
108 | 108 | |
109 | -<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?> |
|
109 | +<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?> |
|
110 | 110 | |
111 | 111 | <?php if (Yii::$app->user->can('backend_default_index')): ?> |
112 | 112 |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | public function actionConfig($key = null) |
29 | 29 | { |
30 | 30 | // get config from global variable (TODO) |
31 | - $data = $GLOBALS['config']; |
|
31 | + $data = $GLOBALS[ 'config' ]; |
|
32 | 32 | if ($key) { |
33 | 33 | $keys = explode('.', $key); |
34 | - if (isset($keys[0])) { |
|
35 | - $data = $GLOBALS['config'][$keys[0]]; |
|
34 | + if (isset($keys[ 0 ])) { |
|
35 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ]; |
|
36 | 36 | } |
37 | - if (isset($keys[1])) { |
|
38 | - $data = $GLOBALS['config'][$keys[0]][$keys[1]]; |
|
37 | + if (isset($keys[ 1 ])) { |
|
38 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ][ $keys[ 1 ] ]; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | $this->stdout(VarDumper::dumpAsString($data)); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function actionVersion() |
58 | 58 | { |
59 | 59 | $this->stdout('Application Version: '); |
60 | - $this->stdout(getenv('APP_NAME') . ' '); |
|
60 | + $this->stdout(getenv('APP_NAME').' '); |
|
61 | 61 | $this->stdout(APP_VERSION); |
62 | 62 | echo "\n"; |
63 | 63 | } |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | $this->stdout("=====================\n"); |
73 | 73 | $this->stdout("Initializing application\n"); |
74 | 74 | |
75 | - $this->interactive = (bool)getenv('APP_INTERACTIVE'); |
|
75 | + $this->interactive = (bool) getenv('APP_INTERACTIVE'); |
|
76 | 76 | |
77 | 77 | $this->stdout("\nDatabase\n"); |
78 | 78 | $this->stdout("--------\n"); |
79 | 79 | $this->run('db/create'); |
80 | - $this->run('migrate/up', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
80 | + $this->run('migrate/up', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
81 | 81 | |
82 | 82 | $this->stdout("\nUser\n"); |
83 | 83 | $this->stdout("----\n"); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8), |
88 | 88 | ] |
89 | 89 | ); |
90 | - $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]); |
|
90 | + $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]); |
|
91 | 91 | |
92 | 92 | $this->stdout('Initializing modules'); |
93 | 93 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $this->stdout("\nCleanup\n"); |
103 | 103 | $this->stdout("-------\n"); |
104 | 104 | $this->run('cache/flush-all'); |
105 | - $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
106 | - $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
105 | + $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
106 | + $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | $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]$"'; |
118 | 118 | |
119 | 119 | // create $cmd command |
120 | - $cmd = 'cd "' . $assets . '" && ls | grep -e ' . $matchRegex . ' | xargs rm -rf '; |
|
120 | + $cmd = 'cd "'.$assets.'" && ls | grep -e '.$matchRegex.' | xargs rm -rf '; |
|
121 | 121 | |
122 | 122 | // Set command |
123 | 123 | $command = new Command($cmd); |
124 | 124 | |
125 | 125 | // Prompt user |
126 | - $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); |
|
126 | + $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); |
|
127 | 127 | |
128 | 128 | if ($delete) { |
129 | 129 | // Try to execute $command |
130 | 130 | if ($command->execute()) { |
131 | 131 | echo "Web assets have been deleted.\n\n"; |
132 | 132 | } else { |
133 | - echo "\n" . $command->getError() . "\n"; |
|
133 | + echo "\n".$command->getError()."\n"; |
|
134 | 134 | echo $command->getStdErr(); |
135 | 135 | } |
136 | 136 | } |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | $message = $mailer->compose(); |
144 | 144 | $message |
145 | 145 | ->setTo($to) |
146 | - ->setSubject('Test-Mail from ' . getenv('APP_NAME')) |
|
147 | - ->setTextBody(getenv('APP_TITLE') . ' | ' . getenv('HOSTNAME')); |
|
146 | + ->setSubject('Test-Mail from '.getenv('APP_NAME')) |
|
147 | + ->setTextBody(getenv('APP_TITLE').' | '.getenv('HOSTNAME')); |
|
148 | 148 | |
149 | 149 | if ($message->send()) { |
150 | 150 | $this->stdout('Mail sent'); |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | /* @var $this \yii\web\View */ |
24 | 24 | /* @var $content string */ |
25 | 25 | |
26 | -$this->title .= ' - ' . getenv('APP_TITLE'); |
|
27 | -$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '') . $this->title; |
|
26 | +$this->title .= ' - '.getenv('APP_TITLE'); |
|
27 | +$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '').$this->title; |
|
28 | 28 | |
29 | 29 | SettingsAsset::register($this); |
30 | 30 | |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | \yii\base\Event::on( |
33 | 33 | \yii\web\View::className(), |
34 | 34 | \yii\web\View::EVENT_AFTER_RENDER, |
35 | - function ($e) { |
|
35 | + function($e) { |
|
36 | 36 | // disable unbundled asset |
37 | - $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null; |
|
37 | + $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null; |
|
38 | 38 | // disable bundled asset |
39 | - $e->sender->assetBundles['bootstrap'] = null; |
|
39 | + $e->sender->assetBundles[ 'bootstrap' ] = null; |
|
40 | 40 | } |
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | 44 | // Favicon |
45 | 45 | if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets', null)) { |
46 | - $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]); |
|
46 | + $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | ?> |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | $languages = explode(',', getenv('APP_LANGUAGES')); |
22 | 22 | |
23 | 23 | // prepare asset bundle config |
24 | -$bundles = []; |
|
24 | +$bundles = [ ]; |
|
25 | 25 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
26 | 26 | // include generated asset-bundle configuration |
27 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
27 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
28 | 28 | // disable loading of bundles skin file, when using bundled assets |
29 | 29 | Yii::$container->set( |
30 | 30 | AdminLteAsset::className(), |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return [ |
41 | 41 | 'id' => 'app', |
42 | 42 | 'name' => getenv('APP_TITLE'), |
43 | - 'language' => $languages[0], |
|
43 | + 'language' => $languages[ 0 ], |
|
44 | 44 | 'basePath' => '@app', |
45 | 45 | 'vendorPath' => '@root/vendor', |
46 | 46 | 'runtimePath' => '@root/runtime', |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ], |
59 | 59 | 'params' => [ |
60 | 60 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
61 | - 'context.menuItems' => [], |
|
61 | + 'context.menuItems' => [ ], |
|
62 | 62 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
63 | 63 | 'backend.browserSupport' => [ |
64 | 64 | 'Chrome' => 72, |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'container' => [ |
75 | 75 | 'definitions' => [ |
76 | 76 | AuthDbManagerComponent::class => [ |
77 | - 'defaultRoles' => ['Default'], |
|
77 | + 'defaultRoles' => [ 'Default' ], |
|
78 | 78 | 'cache' => 'cache' |
79 | 79 | ], |
80 | 80 | Da\User\Controller\AdminController::class => [ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
125 | 125 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
126 | 126 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
127 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
127 | + 'prefix' => getenv('APP_NAME').'/public', |
|
128 | 128 | 'region' => getenv('AMAZON_S3_BUCKET_REGION'), |
129 | 129 | ], |
130 | 130 | 'fsRuntime' => [ |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | 'common' => [ |
151 | 151 | 'class' => \codemix\streamlog\Target::class, |
152 | 152 | 'url' => 'php://stderr', |
153 | - 'levels' => ['error', 'warning'], |
|
154 | - 'logVars' => [], |
|
153 | + 'levels' => [ 'error', 'warning' ], |
|
154 | + 'logVars' => [ ], |
|
155 | 155 | 'replaceNewline' => (APP_TYPE == 'console') ? null : '', |
156 | 156 | ], |
157 | 157 | ], |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | 'messageConfig' => [ |
173 | 173 | 'charset' => 'UTF-8', |
174 | 174 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
175 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')], |
|
175 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ], |
|
176 | 176 | ], |
177 | 177 | ], |
178 | 178 | 'queue' => [ |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | 'user' => [ |
195 | 195 | 'class' => \dmstr\web\User::class, |
196 | 196 | 'enableAutoLogin' => true, |
197 | - 'loginUrl' => ['/user/security/login'], |
|
197 | + 'loginUrl' => [ '/user/security/login' ], |
|
198 | 198 | 'identityClass' => Da\User\Model\User::class, |
199 | - 'rootUsers' => ['admin'], |
|
199 | + 'rootUsers' => [ 'admin' ], |
|
200 | 200 | ], |
201 | 201 | 'urlManager' => [ |
202 | 202 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -227,37 +227,37 @@ discard block |
||
227 | 227 | 'auto_reload' => true, |
228 | 228 | ], |
229 | 229 | 'globals' => [ |
230 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
231 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
232 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
233 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
234 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
235 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
236 | - 'Markdown' => ['class' => \yii\helpers\Markdown::class], |
|
230 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
231 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
232 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
233 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
234 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
235 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
236 | + 'Markdown' => [ 'class' => \yii\helpers\Markdown::class ], |
|
237 | 237 | ], |
238 | 238 | 'functions' => [ |
239 | - 'image' => function ($imageSource, $preset = null) { |
|
239 | + 'image' => function($imageSource, $preset = null) { |
|
240 | 240 | // sanitize input |
241 | 241 | $preset = trim($preset, "/"); |
242 | 242 | $baseUrl = trim(Yii::$app->settings->get('imgBaseUrl', 'app.frontend'), "/"); |
243 | 243 | $prefix = trim(Yii::$app->settings->get('imgHostPrefix', 'app.frontend'), "/"); |
244 | - $imageSourceFull = $imageSource . Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
|
244 | + $imageSourceFull = $imageSource.Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
|
245 | 245 | |
246 | 246 | // build remote URL |
247 | - $remoteUrl = implode('/', array_filter([$prefix, $imageSourceFull])); |
|
247 | + $remoteUrl = implode('/', array_filter([ $prefix, $imageSourceFull ])); |
|
248 | 248 | |
249 | 249 | // add HMAC sign key to preset when using imageproxy, see also https://github.com/willnorris/imageproxy#examples |
250 | 250 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
251 | 251 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
252 | - $preset .= ',s' . strtr( |
|
252 | + $preset .= ',s'.strtr( |
|
253 | 253 | base64_encode(hash_hmac('sha256', $remoteUrl, $key, 1)), |
254 | 254 | '/+', |
255 | 255 | '_-' |
256 | 256 | ); |
257 | 257 | } |
258 | - return implode('/', array_filter([$baseUrl,$preset,$remoteUrl])); |
|
258 | + return implode('/', array_filter([ $baseUrl, $preset, $remoteUrl ])); |
|
259 | 259 | }, |
260 | - 't' => function ($category, $message) { |
|
260 | + 't' => function($category, $message) { |
|
261 | 261 | return Yii::t($category, $message); |
262 | 262 | }, |
263 | 263 | ], |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | 'modules' => [ |
272 | 272 | 'audit' => [ |
273 | 273 | 'class' => \bedezign\yii2\audit\Audit::class, |
274 | - 'accessRoles' => ['audit-module'], |
|
274 | + 'accessRoles' => [ 'audit-module' ], |
|
275 | 275 | 'layout' => $boxLayout, |
276 | 276 | 'panels' => [ |
277 | 277 | 'audit/trail' => [ |
@@ -355,12 +355,12 @@ discard block |
||
355 | 355 | [ |
356 | 356 | 'connection' => 'db', |
357 | 357 | 'table' => '{{%hrzg_widget_template}}', |
358 | - 'columns' => ['twig_template'] |
|
358 | + 'columns' => [ 'twig_template' ] |
|
359 | 359 | ], |
360 | 360 | [ |
361 | 361 | 'connection' => 'db', |
362 | 362 | 'table' => '{{%twig}}', |
363 | - 'columns' => ['value'] |
|
363 | + 'columns' => [ 'value' ] |
|
364 | 364 | ] |
365 | 365 | ], |
366 | 366 | 'scanners' => [ |
@@ -369,15 +369,15 @@ discard block |
||
369 | 369 | ScannerJavaScriptFunction::class, |
370 | 370 | ScannerDatabase::class |
371 | 371 | ], |
372 | - 'allowedIPs' => ['*'], |
|
373 | - 'roles' => ['translate-module'], |
|
372 | + 'allowedIPs' => [ '*' ], |
|
373 | + 'roles' => [ 'translate-module' ], |
|
374 | 374 | ], |
375 | 375 | 'user' => [ |
376 | 376 | 'class' => Da\User\Module::class, |
377 | 377 | 'layout' => '@app/views/layouts/container', |
378 | 378 | 'defaultRoute' => 'admin', |
379 | 379 | 'administratorPermissionName' => 'user-module', |
380 | - 'administrators' => ['admin'], |
|
380 | + 'administrators' => [ 'admin' ], |
|
381 | 381 | 'enableFlashMessages' => false, |
382 | 382 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
383 | 383 | 'mailParams' => [ |
@@ -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,7 +41,7 @@ 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}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false, |
|
44 | + "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG) ? 'debug' : 'release').'.php' => false, |
|
45 | 45 | ]; |
46 | 46 | |
47 | 47 | if (!empty(getenv('APP_CONFIG_FILE'))) { |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | // Merge additional configurations |
50 | 50 | foreach ($additionalConfigFiles as $alias) { |
51 | 51 | $file = Yii::getAlias($alias); |
52 | - $configFiles[$file] = true; |
|
52 | + $configFiles[ $file ] = true; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | 56 | // Merge configurations |
57 | - $config = []; |
|
57 | + $config = [ ]; |
|
58 | 58 | //var_dump($configFiles);exit; |
59 | 59 | Yii::trace($configFiles, __METHOD__); |
60 | 60 | foreach ($configFiles as $file => $isRequired) { |