Completed
Pull Request — master (#22)
by Elias
10:48
created
migrations/legacy/migration-command/m000508_053522_fix_migration_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/config/console.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
         'db' => [
20 20
             'class' => \dmstr\console\controllers\MysqlController::class,
21 21
             'noDataTables' => [
22
-                getenv('DATABASE_TABLE_PREFIX') . 'auth_assignment',
23
-                getenv('DATABASE_TABLE_PREFIX') . 'migration',
24
-                getenv('DATABASE_TABLE_PREFIX') . 'user',
25
-                getenv('DATABASE_TABLE_PREFIX') . 'profile',
26
-                getenv('DATABASE_TABLE_PREFIX') . 'token',
27
-                getenv('DATABASE_TABLE_PREFIX') . 'social_account',
28
-                getenv('DATABASE_TABLE_PREFIX') . 'log',
29
-                getenv('DATABASE_TABLE_PREFIX') . 'session',
30
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_data',
31
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_entry',
32
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_error',
33
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_javascript',
34
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_mail',
35
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_trail',
36
-                getenv('DATABASE_TABLE_PREFIX') . 'dmstr_contact_log',
37
-                getenv('DATABASE_TABLE_PREFIX') . 'queue_manager',
22
+                getenv('DATABASE_TABLE_PREFIX').'auth_assignment',
23
+                getenv('DATABASE_TABLE_PREFIX').'migration',
24
+                getenv('DATABASE_TABLE_PREFIX').'user',
25
+                getenv('DATABASE_TABLE_PREFIX').'profile',
26
+                getenv('DATABASE_TABLE_PREFIX').'token',
27
+                getenv('DATABASE_TABLE_PREFIX').'social_account',
28
+                getenv('DATABASE_TABLE_PREFIX').'log',
29
+                getenv('DATABASE_TABLE_PREFIX').'session',
30
+                getenv('DATABASE_TABLE_PREFIX').'audit_data',
31
+                getenv('DATABASE_TABLE_PREFIX').'audit_entry',
32
+                getenv('DATABASE_TABLE_PREFIX').'audit_error',
33
+                getenv('DATABASE_TABLE_PREFIX').'audit_javascript',
34
+                getenv('DATABASE_TABLE_PREFIX').'audit_mail',
35
+                getenv('DATABASE_TABLE_PREFIX').'audit_trail',
36
+                getenv('DATABASE_TABLE_PREFIX').'dmstr_contact_log',
37
+                getenv('DATABASE_TABLE_PREFIX').'queue_manager',
38 38
                 'filefly_hashmap', # TODO: fix prefix in module
39 39
             ],
40 40
         ],
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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,
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.
src/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.
src/views/layouts/main.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
     \yii\base\Event::on(
33 33
         \yii\web\View::className(),
34 34
         \yii\web\View::EVENT_AFTER_RENDER,
35
-        function ($e) {
35
+        function($e) {
36 36
             // disable unbundled asset
37
-            $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null;
37
+            $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null;
38 38
             // disable bundled asset
39
-            $e->sender->assetBundles['bootstrap'] = null;
39
+            $e->sender->assetBundles[ 'bootstrap' ] = null;
40 40
         }
41 41
     );
42 42
 }
43 43
 
44 44
 // Favicon
45 45
 if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets', null)) {
46
-    $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]);
46
+    $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]);
47 47
 }
48 48
 
49 49
 ?>
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
     'linkSelector' => '.frontend-reload',
71 71
 ]) ?>
72 72
 
73
-<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?>
73
+<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?>
74 74
 
75 75
 <!-- Navbar -->
76 76
 <?php
77 77
 if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) {
78
-    echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']);
78
+    echo \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'key' => '_navbar' ]);
79 79
 } else {
80 80
     echo $this->render('_navbar');
81 81
 }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
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
 <?php Pjax::end() ?>
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     ],
107 107
 ]) ?>
108 108
 
109
-<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?>
109
+<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?>
110 110
 
111 111
 <?php if (Yii::$app->user->can('backend_default_index') && Yii::$app->settings->get('backendWidget', 'frontend') === 'toolbar'): ?>
112 112
     <?= Toolbar::widget([
Please login to merge, or discard this patch.
src/config/common.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 $languages = explode(',', getenv('APP_LANGUAGES'));
21 21
 
22 22
 // prepare asset bundle config
23
-$bundles = [];
23
+$bundles = [ ];
24 24
 if (getenv('APP_ASSET_USE_BUNDLED')) {
25 25
     // include generated asset-bundle configuration
26
-    $bundles = include Yii::getAlias('@web/bundles') . '/config.php';
26
+    $bundles = include Yii::getAlias('@web/bundles').'/config.php';
27 27
     // disable loading of bundles skin file, when using bundled assets
28 28
     Yii::$container->set(
29 29
         AdminLteAsset::className(),
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 return [
66 66
     'id' => 'app',
67 67
     'name' => getenv('APP_TITLE'),
68
-    'language' => $languages[0],
68
+    'language' => $languages[ 0 ],
69 69
     'basePath' => dirname(__DIR__),
70 70
     'vendorPath' => '@app/../vendor',
71 71
     'runtimePath' => '@app/../runtime',
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     ],
84 84
     'params' => [
85 85
         'adminEmail' => getenv('APP_ADMIN_EMAIL'),
86
-        'context.menuItems' => [],
86
+        'context.menuItems' => [ ],
87 87
         'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self',
88 88
         'backend.browserSupport' => [
89 89
             'Chrome' => 72,
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         ],
109 109
         'authManager' => [
110 110
             'class' => \yii\rbac\DbManager::class,
111
-            'defaultRoles' => ['Default'],
111
+            'defaultRoles' => [ 'Default' ],
112 112
             'cache' => 'cache'
113 113
         ],
114 114
         'cache' =>
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'),
135 135
             'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'),
136 136
             'bucket' => getenv('AMAZON_S3_BUCKET_NAME'),
137
-            'prefix' => getenv('APP_NAME') . '/public',
137
+            'prefix' => getenv('APP_NAME').'/public',
138 138
             'region' => getenv('AMAZON_S3_BUCKET_REGION'),
139 139
         ],
140 140
         'fsRuntime' => [
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
                 'common' => [
161 161
                     'class' => \codemix\streamlog\Target::class,
162 162
                     'url' => 'php://stderr',
163
-                    'levels' => ['error', 'warning'],
164
-                    'logVars' => [],
163
+                    'levels' => [ 'error', 'warning' ],
164
+                    'logVars' => [ ],
165 165
                     'replaceNewline' => (APP_TYPE == 'console') ? null : '',
166 166
                 ],
167 167
             ],
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
         'user' => [
197 197
             'class' => \dmstr\web\User::class,
198 198
             'enableAutoLogin' => true,
199
-            'loginUrl' => ['/user/security/login'],
199
+            'loginUrl' => [ '/user/security/login' ],
200 200
             'identityClass' => Da\User\Model\User::class,
201
-            'rootUsers' => ['admin'],
201
+            'rootUsers' => [ 'admin' ],
202 202
         ],
203 203
         'urlManager' => [
204 204
             'class' => \codemix\localeurls\UrlManager::class,
@@ -229,16 +229,16 @@  discard block
 block discarded – undo
229 229
                         'auto_reload' => true,
230 230
                     ],
231 231
                     'globals' => [
232
-                        'Html' => ['class' => \yii\helpers\Html::class],
233
-                        'Json' => ['class' => \yii\helpers\Json::class],
234
-                        'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class],
235
-                        'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class],
236
-                        'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class],
237
-                        'Url' => ['class' => \yii\helpers\Url::class],
238
-                        'Markdown' => ['class' => \yii\helpers\Markdown::class],
232
+                        'Html' => [ 'class' => \yii\helpers\Html::class ],
233
+                        'Json' => [ 'class' => \yii\helpers\Json::class ],
234
+                        'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ],
235
+                        'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ],
236
+                        'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ],
237
+                        'Url' => [ 'class' => \yii\helpers\Url::class ],
238
+                        'Markdown' => [ 'class' => \yii\helpers\Markdown::class ],
239 239
                     ],
240 240
                     'functions' => [
241
-                        'image' => function ($imageSource, $preset = null) {
241
+                        'image' => function($imageSource, $preset = null) {
242 242
                             // sanitize input
243 243
                             $preset = trim($preset, "/");
244 244
                             $baseUrl = trim(Yii::$app->settings->get('imgBaseUrl', 'app.frontend'), "/");
@@ -250,15 +250,15 @@  discard block
 block discarded – undo
250 250
                             // add HMAC sign key to preset when using imageproxy, see also https://github.com/willnorris/imageproxy#examples
251 251
                             if (getenv('IMAGEPROXY_SIGNATURE_KEY')) {
252 252
                                 $key = getenv('IMAGEPROXY_SIGNATURE_KEY');
253
-                                $preset .= ',s' . strtr(
253
+                                $preset .= ',s'.strtr(
254 254
                                     base64_encode(hash_hmac('sha256', $remoteUrl, $key, 1)),
255 255
                                     '/+',
256 256
                                     '_-'
257 257
                                     );
258 258
                             }
259
-                            return $baseUrl . '/' . $preset . '/' . $remoteUrl;
259
+                            return $baseUrl.'/'.$preset.'/'.$remoteUrl;
260 260
                         },
261
-                        't' => function ($category, $message) {
261
+                        't' => function($category, $message) {
262 262
                             return Yii::t($category, $message);
263 263
                         },
264 264
                     ],
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     'modules' => [
273 273
         'audit' => [
274 274
             'class' => \bedezign\yii2\audit\Audit::class,
275
-            'accessRoles' => ['audit-module'],
275
+            'accessRoles' => [ 'audit-module' ],
276 276
             'layout' => $boxLayout,
277 277
             'panels' => [
278 278
                 'audit/trail' => [
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
                 [
359 359
                     'connection' => 'db',
360 360
                     'table' => '{{%hrzg_widget_template}}',
361
-                    'columns' => ['twig_template']
361
+                    'columns' => [ 'twig_template' ]
362 362
                 ],
363 363
                 [
364 364
                     'connection' => 'db',
365 365
                     'table' => '{{%twig}}',
366
-                    'columns' => ['value']
366
+                    'columns' => [ 'value' ]
367 367
                 ]
368 368
             ],
369 369
             'scanners' => [
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
                 ScannerJavaScriptFunction::class,
373 373
                 ScannerDatabase::class
374 374
             ],
375
-            'allowedIPs' => ['*'],
376
-            'roles' => ['translate-module'],
375
+            'allowedIPs' => [ '*' ],
376
+            'roles' => [ 'translate-module' ],
377 377
         ],
378 378
         'user' => [
379 379
             'class' => Da\User\Module::class,
380 380
             'layout' => '@app/views/layouts/container',
381 381
             'defaultRoute' => 'admin',
382 382
             'administratorPermissionName' => 'user-module',
383
-            'administrators' => ['admin'],
383
+            'administrators' => [ 'admin' ],
384 384
             'enableFlashMessages' => false,
385 385
             'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'),
386 386
             'mailParams' => [
Please login to merge, or discard this patch.