@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | </tr> |
30 | 30 | <tr> |
31 | 31 | <th>Virtual Host</th> |
32 | - <td><code><?= isset($_SERVER['HTTP_HOST']) ? |
|
33 | - $_SERVER['HTTP_HOST'] : 'n/a' ?></code></td> |
|
32 | + <td><code><?= isset($_SERVER[ 'HTTP_HOST' ]) ? |
|
33 | + $_SERVER[ 'HTTP_HOST' ] : 'n/a' ?></code></td> |
|
34 | 34 | </tr> |
35 | 35 | <tr> |
36 | 36 | <th>Hostname</th> |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <div class="pull-right"> |
49 | - <?= Html::a(FA::icon(FA::_COG), ['/backend'], ['class' => 'btn btn-default btn-xs']) ?> |
|
49 | + <?= Html::a(FA::icon(FA::_COG), [ '/backend' ], [ 'class' => 'btn btn-default btn-xs' ]) ?> |
|
50 | 50 | </div> |
51 | 51 | <div class="clearfix"></div> |
52 | 52 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'view' => [ |
17 | 17 | 'renderers' => [ |
18 | 18 | 'twig' => [ |
19 | - 'extensions' => (getenv('TWIG_DEBUG_MODE')) ? [new Twig_Extension_Debug()] : null, |
|
19 | + 'extensions' => (getenv('TWIG_DEBUG_MODE')) ? [ new Twig_Extension_Debug() ] : null, |
|
20 | 20 | 'options' => [ |
21 | 21 | 'debug' => (getenv('TWIG_DEBUG_MODE')) ? true : false, |
22 | 22 | ], |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | // Settings for web-application only |
19 | 19 | return [ |
20 | - 'on registerMenuItems' => function ($event) { |
|
20 | + 'on registerMenuItems' => function($event) { |
|
21 | 21 | if ($event->sender instanceof ContextMenuItemsInterface) { |
22 | - Yii::$app->params['context.menuItems'] = ArrayHelper::merge( |
|
23 | - Yii::$app->params['context.menuItems'], |
|
22 | + Yii::$app->params[ 'context.menuItems' ] = ArrayHelper::merge( |
|
23 | + Yii::$app->params[ 'context.menuItems' ], |
|
24 | 24 | $event->sender->getMenuItems() |
25 | 25 | ); |
26 | 26 | } |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | 'web' => [ |
38 | 38 | 'class' => Target::class, |
39 | 39 | 'url' => 'php://stdout', |
40 | - 'levels' => ['info', 'trace'], |
|
41 | - 'logVars' => [], |
|
40 | + 'levels' => [ 'info', 'trace' ], |
|
41 | + 'logVars' => [ ], |
|
42 | 42 | 'replaceNewline' => YII_DEBUG ? null : '', |
43 | 43 | 'enabled' => YII_DEBUG && !YII_ENV_TEST, |
44 | 44 | ], |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'settings' => [ |
59 | 59 | 'class' => SettingsModule::class, |
60 | 60 | 'layout' => '@backend/views/layouts/box', |
61 | - 'accessRoles' => ['settings-module'], |
|
61 | + 'accessRoles' => [ 'settings-module' ], |
|
62 | 62 | ], |
63 | 63 | ], |
64 | 64 | ]; |
@@ -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', |
@@ -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) { |
@@ -16,9 +16,9 @@ |
||
16 | 16 | // Codeception testing routes |
17 | 17 | if (YII_ENV_TEST && file_exists($rootPath . '/tests/codeception/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/codeception/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/codeception/c3.php')) { |
|
17 | +if (YII_ENV_TEST && file_exists($rootPath.'/tests/codeception/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/codeception/c3.php'; |
|
22 | + require_once $rootPath.'/tests/codeception/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(); |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | ?> |
6 | 6 | <div class="site-index"> |
7 | - <?= TwigWidget::widget(['registerMenuItems' => true]) ?> |
|
7 | + <?= TwigWidget::widget([ 'registerMenuItems' => true ]) ?> |
|
8 | 8 | </div> |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | /* @var $this \yii\web\View */ |
25 | 25 | /* @var $content string */ |
26 | 26 | |
27 | -$this->title .= ' - ' . getenv('APP_TITLE'); |
|
28 | -$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '') . $this->title; |
|
27 | +$this->title .= ' - '.getenv('APP_TITLE'); |
|
28 | +$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '').$this->title; |
|
29 | 29 | |
30 | 30 | SettingsAsset::register($this); |
31 | 31 | |
@@ -33,18 +33,18 @@ discard block |
||
33 | 33 | Event::on( |
34 | 34 | View::class, |
35 | 35 | View::EVENT_AFTER_RENDER, |
36 | - function ($e) { |
|
36 | + function($e) { |
|
37 | 37 | // disable unbundled asset |
38 | - $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null; |
|
38 | + $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null; |
|
39 | 39 | // disable bundled asset |
40 | - $e->sender->assetBundles['bootstrap'] = null; |
|
40 | + $e->sender->assetBundles[ 'bootstrap' ] = null; |
|
41 | 41 | } |
42 | 42 | ); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Favicon |
46 | 46 | if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets')) { |
47 | - $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]); |
|
47 | + $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | ?> |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | |
66 | 66 | <?php $this->beginBody() ?> |
67 | 67 | |
68 | -<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
|
68 | +<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?> |
|
69 | 69 | |
70 | 70 | <!-- Navbar --> |
71 | 71 | <?php |
72 | 72 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
73 | - echo TwigWidget::widget(['key' => '_navbar']); |
|
73 | + echo TwigWidget::widget([ 'key' => '_navbar' ]); |
|
74 | 74 | } else { |
75 | 75 | echo $this->render('_navbar'); |
76 | 76 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ?> |
79 | 79 | |
80 | 80 | <!-- Content --> |
81 | -<?= TwigWidget::widget(['key' => '_beforeContent', 'renderEmpty' => false]) ?> |
|
81 | +<?= TwigWidget::widget([ 'key' => '_beforeContent', 'renderEmpty' => false ]) ?> |
|
82 | 82 | |
83 | 83 | <div class="wrap"> |
84 | 84 | |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | |
87 | 87 | </div> |
88 | 88 | |
89 | -<?= TwigWidget::widget(['key' => '_afterContent', 'renderEmpty' => false]) ?> |
|
89 | +<?= TwigWidget::widget([ 'key' => '_afterContent', 'renderEmpty' => false ]) ?> |
|
90 | 90 | |
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 | <!-- User flash messages --> |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ], |
106 | 106 | ]) ?> |
107 | 107 | |
108 | -<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?> |
|
108 | +<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?> |
|
109 | 109 | |
110 | 110 | <?php if (Yii::$app->user->can('backend_default_index')): ?> |
111 | 111 |