| @@ -5,6 +5,6 @@ | ||
| 5 | 5 | |
| 6 | 6 | <div class="site-index"> | 
| 7 | 7 | |
| 8 | - <?= \dmstr\modules\prototype\widgets\TwigWidget::widget(['registerMenuItems' => true]) ?> | |
| 8 | + <?= \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'registerMenuItems' => true ]) ?> | |
| 9 | 9 | |
| 10 | 10 | </div> | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | <?= | 
| 6 | 6 | \yii\widgets\Breadcrumbs::widget( | 
| 7 | 7 | [ | 
| 8 | - 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | |
| 8 | + 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [ ], | |
| 9 | 9 | ] | 
| 10 | 10 | ) ?> | 
| 11 | 11 | </div> | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 |  Yii::setAlias('@webroot', '@root/web'); | 
| 27 | 27 | |
| 28 | 28 | // Use a closure to not pollute the global namespace | 
| 29 | -return call_user_func(function () { | |
| 29 | +return call_user_func(function() { | |
| 30 | 30 | |
| 31 | 31 |      /*function checkFile(){ | 
| 32 | 32 |          if (file_exists($file)) { | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 |          "{$configDir}/".APP_TYPE.'.php' => true, | 
| 41 | 41 |          "{$configDir}/common-".YII_ENV.'.php' => false, | 
| 42 | 42 |          "{$configDir}/".APP_TYPE.'-'.YII_ENV.'.php' => false, | 
| 43 | -        "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false, | |
| 43 | +        "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG) ? 'debug' : 'release').'.php' => false, | |
| 44 | 44 | ]; | 
| 45 | 45 | |
| 46 | 46 |      if (!empty(getenv('APP_CONFIG_FILE'))) { | 
| @@ -48,12 +48,12 @@ discard block | ||
| 48 | 48 | // Merge additional configurations | 
| 49 | 49 |          foreach ($additionalConfigFiles as $alias) { | 
| 50 | 50 | $file = Yii::getAlias($alias); | 
| 51 | - $configFiles[$file] = true; | |
| 51 | + $configFiles[ $file ] = true; | |
| 52 | 52 | } | 
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | // Merge configurations | 
| 56 | - $config = []; | |
| 56 | + $config = [ ]; | |
| 57 | 57 | //var_dump($configFiles);exit; | 
| 58 | 58 | Yii::trace($configFiles, __METHOD__); | 
| 59 | 59 |      foreach ($configFiles as $file => $isRequired) { | 
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | require($rootPath.'/src/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 | |
| @@ -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 | ], | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | <?= | 
| 6 | 6 | \yii\widgets\Breadcrumbs::widget( | 
| 7 | 7 | [ | 
| 8 | - 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], | |
| 8 | + 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [ ], | |
| 9 | 9 | ] | 
| 10 | 10 | ) ?> | 
| 11 | 11 | </div> | 
| @@ -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 | |
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | <p class="small"> | 
| 43 | 43 |                      Built with <?= Html::a('phd', 'http://phd.dmstr.io') ?> from | 
| 44 | 44 | <?= Html::a( | 
| 45 | - 'dmstr', | |
| 45 | + 'dmstr', | |
| 46 | 46 | 'http://www.diemeisterei.de' | 
| 47 | 47 | ) ?> | 
| 48 | 48 | </p> | 
| @@ -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)); | 
| @@ -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("\n\nDone.\n"); | 
| 93 | 93 | } | 
| @@ -100,8 +100,8 @@ discard block | ||
| 100 | 100 |          $this->stdout("\nCleanup\n"); | 
| 101 | 101 |          $this->stdout("-------\n"); | 
| 102 | 102 |          $this->run('cache/flush-all'); | 
| 103 | -        $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]); | |
| 104 | -        $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); | |
| 103 | +        $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); | |
| 104 | +        $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | /** | 
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 | $command = new Command($cmd); | 
| 122 | 122 | |
| 123 | 123 | // Prompt user | 
| 124 | -        $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); | |
| 124 | +        $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); | |
| 125 | 125 | |
| 126 | 126 |          if ($delete) { | 
| 127 | 127 | // Try to execute $command | 
| @@ -6,22 +6,22 @@ discard block | ||
| 6 | 6 | use yii\bootstrap\NavBar; | 
| 7 | 7 | |
| 8 | 8 | // initialize local variables | 
| 9 | -$menuItems = []; | |
| 10 | -$languageItems = []; | |
| 9 | +$menuItems = [ ]; | |
| 10 | +$languageItems = [ ]; | |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | // prepare languages | 
| 14 | 14 |  foreach (\Yii::$app->urlManager->languages as $language) { | 
| 15 | - $languageItems[] = [ | |
| 16 | - 'url' => ['/', \Yii::$app->urlManager->languageParam => $language], | |
| 15 | + $languageItems[ ] = [ | |
| 16 | + 'url' => [ '/', \Yii::$app->urlManager->languageParam => $language ], | |
| 17 | 17 | 'label' => $language, | 
| 18 | 18 | ]; | 
| 19 | 19 | } | 
| 20 | 20 | |
| 21 | 21 | // add language items to menu | 
| 22 | -$menuItems[] = [ | |
| 22 | +$menuItems[ ] = [ | |
| 23 | 23 | 'label' => '<i class="glyphicon glyphicon-globe"></i> '.\Yii::$app->language, | 
| 24 | - 'options' => ['id' => 'link-languages-menu'], | |
| 24 | + 'options' => [ 'id' => 'link-languages-menu' ], | |
| 25 | 25 | 'items' => $languageItems, | 
| 26 | 26 | ]; | 
| 27 | 27 | |
| @@ -30,30 +30,30 @@ discard block | ||
| 30 | 30 |      if (\Yii::$app->user->isGuest) { | 
| 31 | 31 | // unauthorized users | 
| 32 | 32 | //$menuItems[] = ['label' => 'Signup', 'url' => ['/user/registration/register']]; | 
| 33 | - $menuItems[] = [ | |
| 33 | + $menuItems[ ] = [ | |
| 34 | 34 | 'label' => 'Login', | 
| 35 | - 'url' => ['/user/security/login'], | |
| 36 | - 'linkOptions' => ['id' => 'link-login'], | |
| 35 | + 'url' => [ '/user/security/login' ], | |
| 36 | + 'linkOptions' => [ 'id' => 'link-login' ], | |
| 37 | 37 | ]; | 
| 38 | 38 |      } else { | 
| 39 | 39 | // logged in users | 
| 40 | - $menuItems[] = [ | |
| 40 | + $menuItems[ ] = [ | |
| 41 | 41 | 'label' => '<i class="glyphicon glyphicon-user"></i> '.\Yii::$app->user->identity->username, | 
| 42 | - 'options' => ['id' => 'link-user-menu'], | |
| 42 | + 'options' => [ 'id' => 'link-user-menu' ], | |
| 43 | 43 | 'items' => [ | 
| 44 | 44 | [ | 
| 45 | 45 | 'label' => '<i class="glyphicon glyphicon-user"></i> Profile', | 
| 46 | - 'url' => ['/user/profile/show', 'id' => \Yii::$app->user->id], | |
| 46 | + 'url' => [ '/user/profile/show', 'id' => \Yii::$app->user->id ], | |
| 47 | 47 | ], | 
| 48 | 48 | [ | 
| 49 | 49 | 'label' => '<i class="glyphicon glyphicon-cog"></i> Settings', | 
| 50 | - 'url' => ['/user/settings/profile'], | |
| 50 | + 'url' => [ '/user/settings/profile' ], | |
| 51 | 51 | ], | 
| 52 | 52 | '<li class="divider"></li>', | 
| 53 | 53 | [ | 
| 54 | 54 | 'label' => '<i class="glyphicon glyphicon-log-out"></i> Logout', | 
| 55 | - 'url' => ['/user/security/logout'], | |
| 56 | - 'linkOptions' => ['data-method' => 'post', 'id' => 'link-logout'], | |
| 55 | + 'url' => [ '/user/security/logout' ], | |
| 56 | + 'linkOptions' => [ 'data-method' => 'post', 'id' => 'link-logout' ], | |
| 57 | 57 | ], | 
| 58 | 58 | ], | 
| 59 | 59 | ]; | 
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | // render root pages | 
| 76 | 76 | echo Nav::widget( | 
| 77 | 77 | [ | 
| 78 | - 'options' => ['class' => 'navbar-nav'], | |
| 78 | + 'options' => [ 'class' => 'navbar-nav' ], | |
| 79 | 79 | 'encodeLabels' => false, | 
| 80 | 80 |          'items' => \dmstr\modules\pages\models\Tree::getMenuItems('root'), | 
| 81 | 81 | ] | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | // render additional menu items (languages, user) | 
| 85 | 85 | echo Nav::widget( | 
| 86 | 86 | [ | 
| 87 | - 'options' => ['class' => 'navbar-nav navbar-right'], | |
| 87 | + 'options' => [ 'class' => 'navbar-nav navbar-right' ], | |
| 88 | 88 | 'encodeLabels' => false, | 
| 89 | 89 | 'items' => $menuItems, | 
| 90 | 90 | ] |