Completed
Push — master ( b24f76...b273a9 )
by Tobias
11:20 queued 11s
created
src/commands/AppController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
config/console.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,22 +18,22 @@  discard block
 block discarded – undo
18 18
         'db' => [
19 19
             'class' => \dmstr\console\controllers\MysqlController::class,
20 20
             'excludeTables' => [
21
-                getenv('DATABASE_TABLE_PREFIX') . 'auth_assignment',
22
-                getenv('DATABASE_TABLE_PREFIX') . 'migration',
23
-                getenv('DATABASE_TABLE_PREFIX') . 'user',
24
-                getenv('DATABASE_TABLE_PREFIX') . 'profile',
25
-                getenv('DATABASE_TABLE_PREFIX') . 'token',
26
-                getenv('DATABASE_TABLE_PREFIX') . 'social_account',
27
-                getenv('DATABASE_TABLE_PREFIX') . 'log',
28
-                getenv('DATABASE_TABLE_PREFIX') . 'session',
29
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_data',
30
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_entry',
31
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_error',
32
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_javascript',
33
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_mail',
34
-                getenv('DATABASE_TABLE_PREFIX') . 'audit_trail',
35
-                getenv('DATABASE_TABLE_PREFIX') . 'dmstr_contact_log',
36
-                getenv('DATABASE_TABLE_PREFIX') . 'queue_manager',
21
+                getenv('DATABASE_TABLE_PREFIX').'auth_assignment',
22
+                getenv('DATABASE_TABLE_PREFIX').'migration',
23
+                getenv('DATABASE_TABLE_PREFIX').'user',
24
+                getenv('DATABASE_TABLE_PREFIX').'profile',
25
+                getenv('DATABASE_TABLE_PREFIX').'token',
26
+                getenv('DATABASE_TABLE_PREFIX').'social_account',
27
+                getenv('DATABASE_TABLE_PREFIX').'log',
28
+                getenv('DATABASE_TABLE_PREFIX').'session',
29
+                getenv('DATABASE_TABLE_PREFIX').'audit_data',
30
+                getenv('DATABASE_TABLE_PREFIX').'audit_entry',
31
+                getenv('DATABASE_TABLE_PREFIX').'audit_error',
32
+                getenv('DATABASE_TABLE_PREFIX').'audit_javascript',
33
+                getenv('DATABASE_TABLE_PREFIX').'audit_mail',
34
+                getenv('DATABASE_TABLE_PREFIX').'audit_trail',
35
+                getenv('DATABASE_TABLE_PREFIX').'dmstr_contact_log',
36
+                getenv('DATABASE_TABLE_PREFIX').'queue_manager',
37 37
                 'filefly_hashmap', # TODO: fix prefix in module
38 38
             ],
39 39
         ],
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                     'class' => \yii\log\FileTarget::class,
80 80
                     'logFile' => '@runtime/logs/console.log',
81 81
                     //'levels' => ['info', 'trace'],
82
-                    'logVars' => [],
82
+                    'logVars' => [ ],
83 83
                     'dirMode' => YII_ENV_DEV ? 0777 : 0775,
84 84
                     'fileMode' => YII_ENV_DEV ? 0666 : null,
85 85
                     'enabled' => YII_DEBUG && !YII_ENV_TEST,
Please login to merge, or discard this patch.