@@ -84,8 +84,7 @@ |
||
84 | 84 | |
85 | 85 | $commands[strtolower("$namespace:" . str_replace('Command', '', $command))] = $this->getContainer()->get($className); |
86 | 86 | } |
87 | - } |
|
88 | - else |
|
87 | + } else |
|
89 | 88 | { |
90 | 89 | $command = $fileInfo->getBasename('.php'); |
91 | 90 | $className = __NAMESPACE__ . "\\Commands\\$command"; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $commands = []; |
56 | 56 | |
57 | 57 | /** @var \DirectoryIterator $fileInfo */ |
58 | - foreach (new \DirectoryIterator(__DIR__ . '/Commands') as $fileInfo) |
|
58 | + foreach (new \DirectoryIterator(__DIR__.'/Commands') as $fileInfo) |
|
59 | 59 | { |
60 | 60 | if ($fileInfo->isDot()) |
61 | 61 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | $command = $subFileInfo->getBasename('.php'); |
78 | - $className = __NAMESPACE__ . "\\Commands\\$namespace\\$command"; |
|
78 | + $className = __NAMESPACE__."\\Commands\\$namespace\\$command"; |
|
79 | 79 | |
80 | 80 | if (!class_exists($className)) |
81 | 81 | { |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | // If the class isn't instantiable, it isn't a valid command |
86 | 86 | if ((new \ReflectionClass($className))->isInstantiable()) |
87 | 87 | { |
88 | - $commands[strtolower("$namespace:" . str_replace('Command', '', $command))] = $this->getContainer()->get($className); |
|
88 | + $commands[strtolower("$namespace:".str_replace('Command', '', $command))] = $this->getContainer()->get($className); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
92 | 92 | else |
93 | 93 | { |
94 | 94 | $command = $fileInfo->getBasename('.php'); |
95 | - $className = __NAMESPACE__ . "\\Commands\\$command"; |
|
95 | + $className = __NAMESPACE__."\\Commands\\$command"; |
|
96 | 96 | |
97 | 97 | if (!class_exists($className)) |
98 | 98 | { |
@@ -161,7 +161,7 @@ |
||
161 | 161 | */ |
162 | 162 | private function doMigration($version) |
163 | 163 | { |
164 | - $sqlFile = 'migrations/' . $version . '.sql'; |
|
164 | + $sqlFile = 'migrations/'.$version.'.sql'; |
|
165 | 165 | |
166 | 166 | if (!$this->filesystem->has($sqlFile)) |
167 | 167 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $container->alias('db', DatabaseDriver::class) |
31 | 31 | ->share( |
32 | 32 | DatabaseDriver::class, |
33 | - function (Container $container) |
|
33 | + function(Container $container) |
|
34 | 34 | { |
35 | 35 | /** @var \Joomla\Registry\Registry $config */ |
36 | 36 | $config = $container->get('config'); |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | $container->alias('db.migrations', Migrations::class) |
48 | 48 | ->set(Migrations::class, |
49 | - function (Container $container) |
|
49 | + function(Container $container) |
|
50 | 50 | { |
51 | 51 | return new Migrations( |
52 | 52 | $container->get('db'), |
53 | - new Filesystem(new Local(APPROOT . '/etc')) |
|
53 | + new Filesystem(new Local(APPROOT.'/etc')) |
|
54 | 54 | ); |
55 | 55 | }, true, true |
56 | 56 | ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ->out('1) Yes') |
63 | 63 | ->out('2) No') |
64 | 64 | ->out() |
65 | - ->out('<question>' . g11n3t('Select:') . '</question>', false); |
|
65 | + ->out('<question>'.g11n3t('Select:').'</question>', false); |
|
66 | 66 | |
67 | 67 | $in = trim($this->getApplication()->in()); |
68 | 68 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->out('No database found.') |
85 | 85 | ->out('Creating the database...', false); |
86 | 86 | |
87 | - $this->db->setQuery('CREATE DATABASE ' . $this->db->quoteName($this->getApplication()->get('database.name'))) |
|
87 | + $this->db->setQuery('CREATE DATABASE '.$this->db->quoteName($this->getApplication()->get('database.name'))) |
|
88 | 88 | ->execute(); |
89 | 89 | |
90 | 90 | $this->db->select($this->getApplication()->get('database.name')); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $dbType = 'mysql'; |
153 | 153 | } |
154 | 154 | |
155 | - $fName = APPROOT . '/etc/' . $dbType . '.sql'; |
|
155 | + $fName = APPROOT.'/etc/'.$dbType.'.sql'; |
|
156 | 156 | |
157 | 157 | if (!file_exists($fName)) |
158 | 158 | { |
@@ -75,8 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | $this->cleanDatabase($tables); |
78 | - } |
|
79 | - catch (\RuntimeException $e) |
|
78 | + } catch (\RuntimeException $e) |
|
80 | 79 | { |
81 | 80 | // Check if the message is "Could not connect to database." Odds are, this means the DB isn't there or the server is down. |
82 | 81 | if (strpos($e->getMessage(), 'Could not connect to database.') !== false) |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | $this->db->select($this->getApplication()->get('database.name')); |
91 | 90 | |
92 | 91 | $this->out('<info>Database created.</info>'); |
93 | - } |
|
94 | - else |
|
92 | + } else |
|
95 | 93 | { |
96 | 94 | throw $e; |
97 | 95 | } |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Stats\Commands; |
4 | 4 | |
5 | 5 | use Joomla\Controller\AbstractController; |
6 | -use Joomla\Database\DatabaseDriver; |
|
7 | 6 | use Stats\CommandInterface; |
8 | 7 | |
9 | 8 | /** |
@@ -30,12 +30,12 @@ |
||
30 | 30 | $this->getApplication()->out('<info>Updating server to git HEAD</info>'); |
31 | 31 | |
32 | 32 | // Pull from remote repo |
33 | - $this->runCommand('cd ' . APPROOT . ' && git pull 2>&1'); |
|
33 | + $this->runCommand('cd '.APPROOT.' && git pull 2>&1'); |
|
34 | 34 | |
35 | 35 | $this->getApplication()->out('<info>Updating Composer resources</info>'); |
36 | 36 | |
37 | 37 | // Run Composer install |
38 | - $this->runCommand('cd ' . APPROOT . ' && composer install --no-dev -o 2>&1'); |
|
38 | + $this->runCommand('cd '.APPROOT.' && composer install --no-dev -o 2>&1'); |
|
39 | 39 | |
40 | 40 | $this->getApplication()->out('<info>Update complete</info>'); |
41 | 41 |
@@ -57,8 +57,7 @@ |
||
57 | 57 | if ($recordExists) |
58 | 58 | { |
59 | 59 | $db->updateObject('#__jstats', $data, ['unique_id']); |
60 | - } |
|
61 | - else |
|
60 | + } else |
|
62 | 61 | { |
63 | 62 | $db->insertObject('#__jstats', $data, ['unique_id']); |
64 | 63 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class) |
53 | 53 | ->share( |
54 | 54 | JoomlaApplication\AbstractCliApplication::class, |
55 | - function (Container $container) |
|
55 | + function(Container $container) |
|
56 | 56 | { |
57 | 57 | $application = new CliApplication( |
58 | 58 | $container->get(Cli::class), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class) |
74 | 74 | ->share( |
75 | 75 | JoomlaApplication\AbstractWebApplication::class, |
76 | - function (Container $container) |
|
76 | + function(Container $container) |
|
77 | 77 | { |
78 | 78 | $application = new WebApplication($container->get(Input::class), $container->get('config')); |
79 | 79 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | $container->share( |
91 | 91 | Input::class, |
92 | - function () |
|
92 | + function() |
|
93 | 93 | { |
94 | 94 | return new Input($_REQUEST); |
95 | 95 | }, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $container->share( |
100 | 100 | Cli::class, |
101 | - function () |
|
101 | + function() |
|
102 | 102 | { |
103 | 103 | return new Cli; |
104 | 104 | }, |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $container->share( |
109 | 109 | Console::class, |
110 | - function (Container $container) |
|
110 | + function(Container $container) |
|
111 | 111 | { |
112 | 112 | $console = new Console; |
113 | 113 | $console->setContainer($container); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $container->share( |
120 | 120 | JoomlaApplication\Cli\Output\Processor\ColorProcessor::class, |
121 | - function (Container $container) |
|
121 | + function(Container $container) |
|
122 | 122 | { |
123 | 123 | $processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor; |
124 | 124 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class) |
141 | 141 | ->share( |
142 | 142 | JoomlaApplication\Cli\Output\Stdout::class, |
143 | - function (Container $container) |
|
143 | + function(Container $container) |
|
144 | 144 | { |
145 | 145 | return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class)); |
146 | 146 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $container->share( |
150 | 150 | Analytics::class, |
151 | - function () |
|
151 | + function() |
|
152 | 152 | { |
153 | 153 | return new Analytics(true); |
154 | 154 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $container->share( |
158 | 158 | Router::class, |
159 | - function (Container $container) |
|
159 | + function(Container $container) |
|
160 | 160 | { |
161 | 161 | $router = (new Router($container->get(Input::class))) |
162 | 162 | ->setContainer($container) |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | $container->share( |
174 | 174 | HelpCommand::class, |
175 | - function (Container $container) |
|
175 | + function(Container $container) |
|
176 | 176 | { |
177 | 177 | $command = new HelpCommand; |
178 | 178 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | $container->share( |
188 | 188 | InstallCommand::class, |
189 | - function (Container $container) |
|
189 | + function(Container $container) |
|
190 | 190 | { |
191 | 191 | $command = new InstallCommand($container->get(DatabaseDriver::class)); |
192 | 192 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | $container->share( |
202 | 202 | SnapshotCommand::class, |
203 | - function (Container $container) |
|
203 | + function(Container $container) |
|
204 | 204 | { |
205 | 205 | $command = new SnapshotCommand($container->get(StatsJsonView::class)); |
206 | 206 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $container->share( |
216 | 216 | UpdateCommand::class, |
217 | - function (Container $container) |
|
217 | + function(Container $container) |
|
218 | 218 | { |
219 | 219 | $command = new UpdateCommand; |
220 | 220 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | $container->share( |
230 | 230 | ClearCommand::class, |
231 | - function (Container $container) |
|
231 | + function(Container $container) |
|
232 | 232 | { |
233 | 233 | $command = new ClearCommand($container->get(Cache::class)); |
234 | 234 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $container->share( |
244 | 244 | MigrateCommand::class, |
245 | - function (Container $container) |
|
245 | + function(Container $container) |
|
246 | 246 | { |
247 | 247 | $command = new MigrateCommand($container->get(Migrations::class)); |
248 | 248 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $container->share( |
259 | 259 | StatusCommand::class, |
260 | - function (Container $container) |
|
260 | + function(Container $container) |
|
261 | 261 | { |
262 | 262 | $command = new StatusCommand($container->get(Migrations::class)); |
263 | 263 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | $container->share( |
273 | 273 | JoomlaCommand::class, |
274 | - function (Container $container) |
|
274 | + function(Container $container) |
|
275 | 275 | { |
276 | 276 | $command = new JoomlaCommand($container->get(GitHub::class)); |
277 | 277 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | |
286 | 286 | $container->share( |
287 | 287 | DisplayControllerGet::class, |
288 | - function (Container $container) |
|
288 | + function(Container $container) |
|
289 | 289 | { |
290 | 290 | $controller = new DisplayControllerGet( |
291 | 291 | $container->get(StatsJsonView::class), |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | $container->share( |
304 | 304 | SubmitControllerCreate::class, |
305 | - function (Container $container) |
|
305 | + function(Container $container) |
|
306 | 306 | { |
307 | 307 | $controller = new SubmitControllerCreate( |
308 | 308 | $container->get(StatsModel::class) |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | $container->share( |
320 | 320 | SubmitControllerGet::class, |
321 | - function (Container $container) |
|
321 | + function(Container $container) |
|
322 | 322 | { |
323 | 323 | $controller = new SubmitControllerGet; |
324 | 324 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $container->share( |
334 | 334 | StatsModel::class, |
335 | - function (Container $container) |
|
335 | + function(Container $container) |
|
336 | 336 | { |
337 | 337 | return new StatsModel( |
338 | 338 | $container->get(DatabaseDriver::class) |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | $container->share( |
345 | 345 | StatsJsonView::class, |
346 | - function (Container $container) |
|
346 | + function(Container $container) |
|
347 | 347 | { |
348 | 348 | return new StatsJsonView( |
349 | 349 | $container->get(StatsModel::class) |
@@ -87,15 +87,15 @@ |
||
87 | 87 | |
88 | 88 | // Allow the next patch release after this one |
89 | 89 | $nextPatch = $explodedVersion[2] + 1; |
90 | - $versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch; |
|
90 | + $versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch; |
|
91 | 91 | |
92 | 92 | // And allow the next minor release after this one |
93 | 93 | $nextMinor = $explodedVersion[1] + 1; |
94 | - $versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0'; |
|
94 | + $versions[] = $explodedVersion[0].'.'.$nextMinor.'.0'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | // Store the version data now |
98 | - $path = APPROOT . '/versions/joomla.json'; |
|
98 | + $path = APPROOT.'/versions/joomla.json'; |
|
99 | 99 | |
100 | 100 | if (file_put_contents($path, json_encode($versions)) === false) |
101 | 101 | { |