Completed
Push — master ( 425df1...444f67 )
by Tobias
12:24
created
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.