@@ -12,7 +12,7 @@ |
||
| 12 | 12 | <div class="container-layout"> |
| 13 | 13 | <div class="container"> |
| 14 | 14 | <?= |
| 15 | - Breadcrumbs::widget(['links' => $this->params['breadcrumbs'] ?? []]) ?> |
|
| 15 | + Breadcrumbs::widget([ 'links' => $this->params[ 'breadcrumbs' ] ?? [ ] ]) ?> |
|
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <div class="container"> |
@@ -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)) { |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 78 | 78 | |
| 79 | 79 | // prepare asset bundle config |
| 80 | -$bundles = []; |
|
| 80 | +$bundles = [ ]; |
|
| 81 | 81 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 82 | 82 | // include generated asset-bundle configuration |
| 83 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
| 83 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
| 84 | 84 | // disable loading of bundles skin file, when using bundled assets |
| 85 | 85 | Yii::$container->set( |
| 86 | 86 | AdminLteAsset::class, |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => 0 |
| 98 | 98 | ]; |
| 99 | 99 | if (getenv('MYSQL_ATTR_SSL_CA')) { |
| 100 | - $dbAttributes[PDO::MYSQL_ATTR_SSL_CA] = getenv('MYSQL_ATTR_SSL_CA'); |
|
| 100 | + $dbAttributes[ PDO::MYSQL_ATTR_SSL_CA ] = getenv('MYSQL_ATTR_SSL_CA'); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // update Redis increment counter according to queue_manager db (workaround) |
| 104 | -Event::on(Queue::class, Queue::EVENT_BEFORE_PUSH, function ($event) { |
|
| 104 | +Event::on(Queue::class, Queue::EVENT_BEFORE_PUSH, function($event) { |
|
| 105 | 105 | // added directly to the SQL query, since param binding |
| 106 | 106 | $table_name = getenv('DATABASE_TABLE_PREFIX').'queue_manager'; |
| 107 | 107 | if (Yii::$app->cache->get('queue_id_synced') !== true) { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | return [ |
| 129 | 129 | 'id' => 'app', |
| 130 | 130 | 'name' => getenv('APP_TITLE'), |
| 131 | - 'language' => $languages[0], |
|
| 131 | + 'language' => $languages[ 0 ], |
|
| 132 | 132 | 'basePath' => '@app', |
| 133 | 133 | 'vendorPath' => '@root/vendor', |
| 134 | 134 | 'runtimePath' => '@root/runtime', |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | ], |
| 147 | 147 | 'params' => [ |
| 148 | 148 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 149 | - 'context.menuItems' => [], |
|
| 149 | + 'context.menuItems' => [ ], |
|
| 150 | 150 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
| 151 | 151 | 'backend.browserSupport' => [ |
| 152 | 152 | 'Chrome' => 87, |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'container' => [ |
| 163 | 163 | 'definitions' => [ |
| 164 | 164 | AuthDbManagerComponent::class => [ |
| 165 | - 'defaultRoles' => ['Default'], |
|
| 165 | + 'defaultRoles' => [ 'Default' ], |
|
| 166 | 166 | 'cache' => 'cache' |
| 167 | 167 | ], |
| 168 | 168 | AdminController::class => [ |
@@ -186,12 +186,12 @@ discard block |
||
| 186 | 186 | 'rules' => [ |
| 187 | 187 | [ |
| 188 | 188 | 'allow' => true, |
| 189 | - 'actions' => ['index'], |
|
| 190 | - 'roles' => ['@'], |
|
| 189 | + 'actions' => [ 'index' ], |
|
| 190 | + 'roles' => [ '@' ], |
|
| 191 | 191 | ], |
| 192 | 192 | [ |
| 193 | 193 | 'allow' => true, |
| 194 | - 'actions' => ['show'], |
|
| 194 | + 'actions' => [ 'show' ], |
|
| 195 | 195 | // allow for all logged in users |
| 196 | 196 | #'roles' => ['@'], |
| 197 | 197 | // allow only if user has 'user' grant or requested his own profile (check by user->id) |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | if (\Yii::$app->user->can('user')) { |
| 203 | 203 | return true; |
| 204 | 204 | } |
| 205 | - if (\Yii::$app->user->id === (int)Yii::$app->request->getQueryParam('id')) { |
|
| 205 | + if (\Yii::$app->user->id === (int) Yii::$app->request->getQueryParam('id')) { |
|
| 206 | 206 | return true; |
| 207 | 207 | } |
| 208 | 208 | return false; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | 'converter' => [ |
| 224 | 224 | 'class' => 'yii\web\AssetConverter', |
| 225 | 225 | 'commands' => [ |
| 226 | - 'less' => ['css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map'], |
|
| 226 | + 'less' => [ 'css', 'nodepkg-linuxstatic lessc {from} {to} --no-color --source-map' ], |
|
| 227 | 227 | ], |
| 228 | 228 | ], |
| 229 | 229 | ], |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
| 264 | 264 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
| 265 | 265 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
| 266 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
| 266 | + 'prefix' => getenv('APP_NAME').'/public', |
|
| 267 | 267 | 'region' => getenv('AMAZON_S3_BUCKET_REGION') |
| 268 | 268 | ], |
| 269 | 269 | 'fsRuntime' => [ |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | 'common' => [ |
| 311 | 311 | 'class' => Target::class, |
| 312 | 312 | 'url' => 'php://stderr', |
| 313 | - 'levels' => ['error', 'warning'], |
|
| 314 | - 'logVars' => [], |
|
| 313 | + 'levels' => [ 'error', 'warning' ], |
|
| 314 | + 'logVars' => [ ], |
|
| 315 | 315 | 'replaceNewline' => APP_TYPE === 'console' ? null : '' |
| 316 | 316 | ] |
| 317 | 317 | ] |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | 'transport' => [ |
| 324 | 324 | 'scheme' => getenv('APP_MAILER_SCHEME') ?: 'smtp', |
| 325 | 325 | 'host' => getenv('APP_MAILER_HOST'), |
| 326 | - 'port' => (int)getenv('APP_MAILER_PORT'), |
|
| 326 | + 'port' => (int) getenv('APP_MAILER_PORT'), |
|
| 327 | 327 | 'encryption' => getenv('APP_MAILER_ENCRYPTION'), |
| 328 | 328 | 'username' => getenv('APP_MAILER_USERNAME'), |
| 329 | 329 | 'password' => getenv('APP_MAILER_PASSWORD') |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | 'charset' => 'UTF-8', |
| 333 | 333 | 'replyTo' => getenv('APP_MAILER_REPLY_TO'), |
| 334 | 334 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
| 335 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')] |
|
| 335 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ] |
|
| 336 | 336 | ] |
| 337 | 337 | ], |
| 338 | 338 | 'queue' => [ |
@@ -359,9 +359,9 @@ discard block |
||
| 359 | 359 | 'user' => [ |
| 360 | 360 | 'class' => User::class, |
| 361 | 361 | 'enableAutoLogin' => true, |
| 362 | - 'loginUrl' => ['/user/security/login'], |
|
| 362 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 363 | 363 | 'identityClass' => UserModel::class, |
| 364 | - 'rootUsers' => ['admin'] |
|
| 364 | + 'rootUsers' => [ 'admin' ] |
|
| 365 | 365 | ], |
| 366 | 366 | 'urlManager' => [ |
| 367 | 367 | 'class' => UrlManager::class, |
@@ -396,18 +396,18 @@ discard block |
||
| 396 | 396 | 'auto_reload' => true |
| 397 | 397 | ], |
| 398 | 398 | 'globals' => [ |
| 399 | - 'Html' => ['class' => Html::class], |
|
| 400 | - 'Json' => ['class' => Json::class], |
|
| 401 | - 'Tree' => ['class' => Tree::class], |
|
| 402 | - 'FA' => ['class' => FA::class], |
|
| 403 | - 'Url' => ['class' => Url::class], |
|
| 404 | - 'Markdown' => ['class' => Markdown::class] |
|
| 399 | + 'Html' => [ 'class' => Html::class ], |
|
| 400 | + 'Json' => [ 'class' => Json::class ], |
|
| 401 | + 'Tree' => [ 'class' => Tree::class ], |
|
| 402 | + 'FA' => [ 'class' => FA::class ], |
|
| 403 | + 'Url' => [ 'class' => Url::class ], |
|
| 404 | + 'Markdown' => [ 'class' => Markdown::class ] |
|
| 405 | 405 | ], |
| 406 | 406 | 'functions' => [ |
| 407 | - 'image' => function ($imageSource, $preset = '') { |
|
| 407 | + 'image' => function($imageSource, $preset = '') { |
|
| 408 | 408 | return ImageUrlHelper::image($imageSource, $preset); |
| 409 | 409 | }, |
| 410 | - 't' => function ($category, $message, $params = [], $language = null) { |
|
| 410 | + 't' => function($category, $message, $params = [ ], $language = null) { |
|
| 411 | 411 | return Yii::t($category, $message, $params, $language); |
| 412 | 412 | } |
| 413 | 413 | ], |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | 'modules' => [ |
| 422 | 422 | 'audit' => [ |
| 423 | 423 | 'class' => AuditModule::class, |
| 424 | - 'accessRoles' => ['audit-module'], |
|
| 424 | + 'accessRoles' => [ 'audit-module' ], |
|
| 425 | 425 | 'layout' => $boxLayout, |
| 426 | 426 | 'panels' => [ |
| 427 | 427 | 'audit/trail' => [ |
@@ -523,12 +523,12 @@ discard block |
||
| 523 | 523 | [ |
| 524 | 524 | 'connection' => 'db', |
| 525 | 525 | 'table' => '{{%hrzg_widget_template}}', |
| 526 | - 'columns' => ['twig_template'] |
|
| 526 | + 'columns' => [ 'twig_template' ] |
|
| 527 | 527 | ], |
| 528 | 528 | [ |
| 529 | 529 | 'connection' => 'db', |
| 530 | 530 | 'table' => '{{%twig}}', |
| 531 | - 'columns' => ['value'] |
|
| 531 | + 'columns' => [ 'value' ] |
|
| 532 | 532 | ] |
| 533 | 533 | ], |
| 534 | 534 | 'scanners' => [ |
@@ -537,8 +537,8 @@ discard block |
||
| 537 | 537 | ScannerJavaScriptFunction::class, |
| 538 | 538 | ScannerDatabase::class |
| 539 | 539 | ], |
| 540 | - 'allowedIPs' => ['*'], |
|
| 541 | - 'roles' => ['translate-module'] |
|
| 540 | + 'allowedIPs' => [ '*' ], |
|
| 541 | + 'roles' => [ 'translate-module' ] |
|
| 542 | 542 | ], |
| 543 | 543 | 'user' => [ |
| 544 | 544 | 'class' => UserModule::class, |
@@ -546,12 +546,12 @@ discard block |
||
| 546 | 546 | 'enableGdprCompliance' => true, |
| 547 | 547 | 'defaultRoute' => 'admin', |
| 548 | 548 | 'administratorPermissionName' => 'user-module', |
| 549 | - 'administrators' => ['admin'], |
|
| 549 | + 'administrators' => [ 'admin' ], |
|
| 550 | 550 | 'enableFlashMessages' => false, |
| 551 | 551 | 'generatePasswords' => true, |
| 552 | 552 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
| 553 | 553 | 'mailParams' => [ |
| 554 | - 'fromEmail' => [getenv('APP_MAILER_FROM')=>getenv('APP_TITLE')] |
|
| 554 | + 'fromEmail' => [ getenv('APP_MAILER_FROM')=>getenv('APP_TITLE') ] |
|
| 555 | 555 | ], |
| 556 | 556 | ], |
| 557 | 557 | 'widgets' => [ |