Completed
Pull Request — master (#33)
by Elias
13:37
created
src/views/site/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,6 +5,6 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
src/views/layouts/container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
src/views/layouts/container-fluid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
src/views/layouts/_modal.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/views/layouts/_navbar.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     ]
Please login to merge, or discard this patch.
src/controllers/SiteController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
 
33 33
     public function actionRootNode()
34 34
     {
35
-        $rootNodeQuery = \dmstr\modules\pages\models\Tree::find()->where(['domain_id' => 'root']);
35
+        $rootNodeQuery = \dmstr\modules\pages\models\Tree::find()->where([ 'domain_id' => 'root' ]);
36 36
         $rootNode = $rootNodeQuery->one();
37
-        return $this->run('/pages/default/page', ['pageId' => $rootNode->id]);
37
+        return $this->run('/pages/default/page', [ 'pageId' => $rootNode->id ]);
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
src/commands/AppController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
     public function actionConfig($key = null)
30 30
     {
31 31
         // get config from global variable (TODO)
32
-        $data = $GLOBALS['config'];
32
+        $data = $GLOBALS[ 'config' ];
33 33
         if ($key) {
34 34
             $keys = explode('.', $key);
35
-            if (isset($keys[0])) {
36
-                $data = $GLOBALS['config'][$keys[0]];
35
+            if (isset($keys[ 0 ])) {
36
+                $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ];
37 37
             }
38
-            if (isset($keys[1])) {
39
-                $data = $GLOBALS['config'][$keys[0]][$keys[1]];
38
+            if (isset($keys[ 1 ])) {
39
+                $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ][ $keys[ 1 ] ];
40 40
             }
41 41
         }
42 42
         $this->stdout(VarDumper::dumpAsString($data));
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     public function actionVersion()
59 59
     {
60 60
         $this->stdout('Application Version: ');
61
-        $this->stdout(getenv('APP_NAME') . ' ');
61
+        $this->stdout(getenv('APP_NAME').' ');
62 62
         $this->stdout(APP_VERSION);
63 63
         echo "\n";
64 64
     }
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
         $this->stdout("=====================\n");
74 74
         $this->stdout("Initializing application\n");
75 75
 
76
-        $this->interactive = (bool)getenv('APP_INTERACTIVE');
76
+        $this->interactive = (bool) getenv('APP_INTERACTIVE');
77 77
 
78 78
         $this->stdout("\nDatabase\n");
79 79
         $this->stdout("--------\n");
80 80
         $this->run('db/create');
81
-        $this->run('migrate/up', ['interactive' => (bool)getenv('APP_INTERACTIVE')]);
81
+        $this->run('migrate/up', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]);
82 82
 
83 83
         $this->stdout("\nUser\n");
84 84
         $this->stdout("----\n");
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8),
89 89
             ]
90 90
         );
91
-        $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]);
91
+        $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]);
92 92
 
93 93
         $this->stdout('Initializing modules');
94 94
 
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
         $this->stdout("\nCleanup\n");
104 104
         $this->stdout("-------\n");
105 105
         $this->run('cache/flush-all');
106
-        $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]);
107
-        $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]);
106
+        $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]);
107
+        $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]);
108 108
     }
109 109
 
110 110
     /**
@@ -118,20 +118,20 @@  discard block
 block discarded – undo
118 118
         $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]$"';
119 119
 
120 120
         // create $cmd command
121
-        $cmd = 'cd "' . $assets . '" && ls | grep -e ' . $matchRegex . ' | xargs rm -rf ';
121
+        $cmd = 'cd "'.$assets.'" && ls | grep -e '.$matchRegex.' | xargs rm -rf ';
122 122
 
123 123
         // Set command
124 124
         $command = new Command($cmd);
125 125
 
126 126
         // Prompt user
127
-        $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]);
127
+        $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]);
128 128
 
129 129
         if ($delete) {
130 130
             // Try to execute $command
131 131
             if ($command->execute()) {
132 132
                 echo "Web assets have been deleted.\n\n";
133 133
             } else {
134
-                echo "\n" . $command->getError() . "\n";
134
+                echo "\n".$command->getError()."\n";
135 135
                 echo $command->getStdErr();
136 136
             }
137 137
         }
Please login to merge, or discard this patch.
config/common-dev.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
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
                     ],
Please login to merge, or discard this patch.
config/web.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 ];
Please login to merge, or discard this patch.