Completed
Push — master ( d3241b...10185f )
by Tobias
14:42
created
src/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.
src/views/layouts/_navbar.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  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
 // create label for dev and test environment
13 13
 switch (YII_ENV) {
@@ -21,22 +21,22 @@  discard block
 block discarded – undo
21 21
 $debugLabel = YII_DEBUG ? "<span class='label label-danger'>DEBUG</span>" : '';
22 22
 
23 23
 // add env & debug label to menu
24
-$menuItems[] = [
24
+$menuItems[ ] = [
25 25
     'label' => $envLabel.' '.$debugLabel,
26 26
 ];
27 27
 
28 28
 // prepare languages
29 29
 foreach (\Yii::$app->urlManager->languages as $language) {
30
-    $languageItems[] = [
31
-        'url' => ['/', \Yii::$app->urlManager->languageParam => $language],
30
+    $languageItems[ ] = [
31
+        'url' => [ '/', \Yii::$app->urlManager->languageParam => $language ],
32 32
         'label' => $language,
33 33
     ];
34 34
 }
35 35
 
36 36
 // add language items to menu
37
-$menuItems[] = [
37
+$menuItems[ ] = [
38 38
     'label' => '<i class="glyphicon glyphicon-globe"></i> '.\Yii::$app->language,
39
-    'options' => ['id' => 'link-languages-menu'],
39
+    'options' => [ 'id' => 'link-languages-menu' ],
40 40
     'items' => $languageItems,
41 41
 ];
42 42
 
@@ -45,30 +45,30 @@  discard block
 block discarded – undo
45 45
     if (\Yii::$app->user->isGuest) {
46 46
         // unauthorized users
47 47
         //$menuItems[] = ['label' => 'Signup', 'url' => ['/user/registration/register']];
48
-        $menuItems[] = [
48
+        $menuItems[ ] = [
49 49
             'label' => 'Login',
50
-            'url' => ['/user/security/login'],
51
-            'linkOptions' => ['id' => 'link-login'],
50
+            'url' => [ '/user/security/login' ],
51
+            'linkOptions' => [ 'id' => 'link-login' ],
52 52
         ];
53 53
     } else {
54 54
         // logged in users
55
-        $menuItems[] = [
55
+        $menuItems[ ] = [
56 56
             'label' => '<i class="glyphicon glyphicon-user"></i> '.\Yii::$app->user->identity->username,
57
-            'options' => ['id' => 'link-user-menu'],
57
+            'options' => [ 'id' => 'link-user-menu' ],
58 58
             'items' => [
59 59
                 [
60 60
                     'label' => '<i class="glyphicon glyphicon-user"></i> Profile',
61
-                    'url' => ['/user/profile/show', 'id' => \Yii::$app->user->id],
61
+                    'url' => [ '/user/profile/show', 'id' => \Yii::$app->user->id ],
62 62
                 ],
63 63
                 [
64 64
                     'label' => '<i class="glyphicon glyphicon-cog"></i> Settings',
65
-                    'url' => ['/user/settings/profile'],
65
+                    'url' => [ '/user/settings/profile' ],
66 66
                 ],
67 67
                 '<li class="divider"></li>',
68 68
                 [
69 69
                     'label' => '<i class="glyphicon glyphicon-log-out"></i> Logout',
70
-                    'url' => ['/user/security/logout'],
71
-                    'linkOptions' => ['data-method' => 'post', 'id' => 'link-logout'],
70
+                    'url' => [ '/user/security/logout' ],
71
+                    'linkOptions' => [ 'data-method' => 'post', 'id' => 'link-logout' ],
72 72
                 ],
73 73
             ],
74 74
         ];
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
             'key' => 'frontend.extra.menuItems',
79 79
             'renderEmpty' => false,
80 80
         ]);
81
-        $menuItems[] = '<li>'.$extraButtons.'</li>';
81
+        $menuItems[ ] = '<li>'.$extraButtons.'</li>';
82 82
 
83 83
         // context menu
84
-        $menuItems[] = [
84
+        $menuItems[ ] = [
85 85
             'label' => '<i class="glyphicon glyphicon-pencil"></i>',
86
-            'visible' => \Yii::$app->user->can('backend_default_index', ['route' => true]),
87
-            'items' => \Yii::$app->params['context.menuItems'],
86
+            'visible' => \Yii::$app->user->can('backend_default_index', [ 'route' => true ]),
87
+            'items' => \Yii::$app->params[ 'context.menuItems' ],
88 88
         ];
89 89
 
90 90
         $backendMenu = \dmstr\widgets\Menu::widget(
91 91
             [
92
-                'options' => ['class' => 'dropdown-menu'],
92
+                'options' => [ 'class' => 'dropdown-menu' ],
93 93
                 'encodeLabels' => false,
94 94
                 'items' => \dmstr\modules\pages\models\Tree::getMenuItems(
95 95
                     'backend',
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
                 ),
99 99
             ]
100 100
         );
101
-        $menuItems[] = [
101
+        $menuItems[ ] = [
102 102
             'label' => '<i class="glyphicon glyphicon-dashboard"></i>',
103
-            'url' => ['/backend'],
104
-            'visible' => \Yii::$app->user->can('backend_default_index', ['route' => true]),
103
+            'url' => [ '/backend' ],
104
+            'visible' => \Yii::$app->user->can('backend_default_index', [ 'route' => true ]),
105 105
             'items' => $backendMenu,
106 106
         ];
107 107
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 // render root pages
122 122
 echo Nav::widget(
123 123
     [
124
-        'options' => ['class' => 'navbar-nav'],
124
+        'options' => [ 'class' => 'navbar-nav' ],
125 125
         'encodeLabels' => false,
126 126
         'items' => \dmstr\modules\pages\models\Tree::getMenuItems('root'),
127 127
     ]
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 // render additional menu items (languages, user)
131 131
 echo Nav::widget(
132 132
     [
133
-        'options' => ['class' => 'navbar-nav navbar-right'],
133
+        'options' => [ 'class' => 'navbar-nav navbar-right' ],
134 134
         'encodeLabels' => false,
135 135
         'items' => $menuItems,
136 136
     ]
Please login to merge, or discard this patch.
src/config/common.php 1 patch
Spacing   +17 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 $languages = explode(',', getenv('APP_LANGUAGES'));
14 14
 
15 15
 // prepare asset bundle config
16
-$bundles = [];
16
+$bundles = [ ];
17 17
 if (getenv('APP_ASSET_USE_BUNDLED')) {
18 18
     $bundles = include Yii::getAlias('@web/bundles').'/config.php';
19 19
 }
20 20
 if (getenv('APP_ASSET_DISABLE_BOOTSTRAP_BUNDLE')) {
21
-    $bundles['yii\bootstrap\BootstrapAsset'] = [
22
-        'css' => [],
21
+    $bundles[ 'yii\bootstrap\BootstrapAsset' ] = [
22
+        'css' => [ ],
23 23
     ];
24 24
 }
25 25
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Basic configuration, used in web and console applications
41 41
 return [
42 42
     'id' => 'app',
43
-    'language' => $languages[0],
43
+    'language' => $languages[ 0 ],
44 44
     'basePath' => realpath(__DIR__.'/..'),
45 45
     'vendorPath' => '@app/../vendor',
46 46
     'runtimePath' => '@app/../runtime',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     ],
55 55
     'params' => [
56 56
         'adminEmail' => getenv('APP_ADMIN_EMAIL'),
57
-        'context.menuItems' => [],
57
+        'context.menuItems' => [ ],
58 58
         'yii.migrations' => [
59 59
             getenv('APP_MIGRATION_LOOKUP'),
60 60
             '@yii/rbac/migrations',
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
             'dirMode' => 0775,
73 73
             // Hashing for distributed systems
74 74
             'hashCallback' => YII_ENV_DEV ?
75
-                null :
76
-                function ($path) {
75
+                null : function($path) {
77 76
                     return YII_ENV.'-'.substr(hash('sha256', $path), 0, 8).'-'.APP_VERSION.'-'.\Yii::$app->cache->get('prototype.less.changed_at');
78 77
                 },
79 78
             // Note: You need to bundle asset with `yii asset` for development/debugging
@@ -125,8 +124,8 @@  discard block
 block discarded – undo
125 124
                 [
126 125
                     'class' => 'codemix\streamlog\Target',
127 126
                     'url' => 'php://stderr',
128
-                    'levels' => ['error', 'warning'],
129
-                    'logVars' => [],
127
+                    'levels' => [ 'error', 'warning' ],
128
+                    'logVars' => [ ],
130 129
                 ],
131 130
             ],
132 131
         ],
@@ -155,9 +154,9 @@  discard block
 block discarded – undo
155 154
         'user' => [
156 155
             'class' => 'dmstr\web\User',
157 156
             'enableAutoLogin' => true,
158
-            'loginUrl' => ['/user/security/login'],
157
+            'loginUrl' => [ '/user/security/login' ],
159 158
             'identityClass' => 'dektrium\user\models\User',
160
-            'rootUsers' => ['admin'],
159
+            'rootUsers' => [ 'admin' ],
161 160
         ],
162 161
         'urlManager' => [
163 162
             'class' => 'codemix\localeurls\UrlManager',
@@ -165,7 +164,7 @@  discard block
 block discarded – undo
165 164
             'showScriptName' => false,
166 165
             'enableDefaultLanguageUrlCode' => true,
167 166
             'baseUrl' => '/',
168
-            'rules' => [],
167
+            'rules' => [ ],
169 168
             'ignoreLanguageUrlPatterns' => [
170 169
                 // route pattern => url pattern
171 170
                 '#^filefly/api#' => '#^filefly/api#',
@@ -202,15 +201,15 @@  discard block
 block discarded – undo
202 201
                 'audit/trail',
203 202
                 'audit/javascript', # enable app.assets.registerJSLoggingAsset via settings
204 203
                 // These provide special functionality and get loaded to activate it
205
-                'audit/error',      // Links the extra error reporting functions (`exception()` and `errorMessage()`)
206
-                'audit/extra',      // Links the data functions (`data()`)
207
-                'audit/curl',       // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`)
204
+                'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`)
205
+                'audit/extra', // Links the data functions (`data()`)
206
+                'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`)
208 207
                 //'audit/db',
209 208
                 //'audit/log',
210 209
                 //'audit/profiling',
211 210
             ],
212 211
             'ignoreActions' => [
213
-                (getenv('APP_AUDIT_DISABLE_ALL_ACTIONS') ? '*':'_'),
212
+                (getenv('APP_AUDIT_DISABLE_ALL_ACTIONS') ? '*' : '_'),
214 213
                 'audit/*',
215 214
                 'help/*',
216 215
                 'gii/*',
@@ -260,8 +259,8 @@  discard block
 block discarded – undo
260 259
             'class' => 'lajax\translatemanager\Module',
261 260
             'root' => '@app/views',
262 261
             'layout' => '@backend/views/layouts/box',
263
-            'allowedIPs' => ['*'],
264
-            'roles' => ['translate-module'],
262
+            'allowedIPs' => [ '*' ],
263
+            'roles' => [ 'translate-module' ],
265 264
         ],
266 265
         'user' => [
267 266
             'class' => 'dektrium\user\Module',
Please login to merge, or discard this patch.