@@ -39,8 +39,7 @@ |
||
39 | 39 | try |
40 | 40 | { |
41 | 41 | $container->get(WebApplication::class)->execute(); |
42 | -} |
|
43 | -catch (\Throwable $e) |
|
42 | +} catch (\Throwable $e) |
|
44 | 43 | { |
45 | 44 | if (!headers_sent()) |
46 | 45 | { |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later |
7 | 7 | */ |
8 | 8 | |
9 | -require dirname(__DIR__) . '/boot.php'; |
|
9 | +require dirname(__DIR__).'/boot.php'; |
|
10 | 10 | |
11 | 11 | use Joomla\Application\{ |
12 | 12 | AbstractApplication, AbstractWebApplication |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $container = (new Container) |
25 | 25 | ->registerServiceProvider(new ApplicationServiceProvider) |
26 | 26 | ->registerServiceProvider(new CacheServiceProvider) |
27 | - ->registerServiceProvider(new ConfigServiceProvider(APPROOT . '/etc/config.json')) |
|
27 | + ->registerServiceProvider(new ConfigServiceProvider(APPROOT.'/etc/config.json')) |
|
28 | 28 | ->registerServiceProvider(new DatabaseServiceProvider) |
29 | 29 | ->registerServiceProvider(new GitHubServiceProvider) |
30 | 30 | ->registerServiceProvider(new MonologServiceProvider); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $response = [ |
61 | 61 | 'error' => true, |
62 | - 'message' => 'An error occurred while executing the application: ' . $e->getMessage() |
|
62 | + 'message' => 'An error occurred while executing the application: '.$e->getMessage() |
|
63 | 63 | ]; |
64 | 64 | |
65 | 65 | echo json_encode($response); |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | try |
64 | 64 | { |
65 | 65 | $this->analytics->sendPageview(); |
66 | - } |
|
67 | - catch (\Exception $e) |
|
66 | + } catch (\Exception $e) |
|
68 | 67 | { |
69 | 68 | // Log the error for reference |
70 | 69 | $this->getLogger()->error( |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | try |
78 | 77 | { |
79 | 78 | $this->router->getController($this->get('uri.route'))->execute(); |
80 | - } |
|
81 | - catch (\Throwable $e) |
|
79 | + } catch (\Throwable $e) |
|
82 | 80 | { |
83 | 81 | // Log the error for reference |
84 | 82 | $this->getLogger()->error( |
@@ -89,11 +89,11 @@ |
||
89 | 89 | public function outputTitle(string $title, string $subTitle = '', int $width = 60) : CliApplication |
90 | 90 | { |
91 | 91 | $this->out(str_repeat('-', $width)); |
92 | - $this->out(str_repeat(' ', $width / 2 - (strlen($title) / 2)) . '<title>' . $title . '</title>'); |
|
92 | + $this->out(str_repeat(' ', $width / 2 - (strlen($title) / 2)).'<title>'.$title.'</title>'); |
|
93 | 93 | |
94 | 94 | if ($subTitle) |
95 | 95 | { |
96 | - $this->out(str_repeat(' ', $width / 2 - (strlen($subTitle) / 2)) . '<b>' . $subTitle . '</b>'); |
|
96 | + $this->out(str_repeat(' ', $width / 2 - (strlen($subTitle) / 2)).'<b>'.$subTitle.'</b>'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $this->out(str_repeat('-', $width)); |
@@ -33,10 +33,10 @@ |
||
33 | 33 | /** |
34 | 34 | * CliApplication constructor. |
35 | 35 | * |
36 | - * @param Input\Cli $input The application's input object. |
|
36 | + * @param Cli $input The application's input object. |
|
37 | 37 | * @param Registry $config The application's configuration. |
38 | - * @param CliOutput $output The application's output object. |
|
39 | - * @param CliInput $cliInput The application's CLI input handler. |
|
38 | + * @param \Joomla\Application\Cli\CliOutput $output The application's output object. |
|
39 | + * @param \Joomla\Application\Cli\CliInput $cliInput The application's CLI input handler. |
|
40 | 40 | * @param Console $console The application's console object. |
41 | 41 | */ |
42 | 42 | public function __construct(Cli $input, Registry $config, CliOutput $output, CliInput $cliInput, Console $console) |
@@ -161,7 +161,7 @@ |
||
161 | 161 | */ |
162 | 162 | private function doMigration(string $version) |
163 | 163 | { |
164 | - $sqlFile = 'migrations/' . $version . '.sql'; |
|
164 | + $sqlFile = 'migrations/'.$version.'.sql'; |
|
165 | 165 | |
166 | 166 | if (!$this->filesystem->has($sqlFile)) |
167 | 167 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | ->out('1) Yes') |
78 | 78 | ->out('2) No') |
79 | 79 | ->out() |
80 | - ->out('<question>' . g11n3t('Select:') . '</question>', false); |
|
80 | + ->out('<question>'.g11n3t('Select:').'</question>', false); |
|
81 | 81 | |
82 | 82 | $in = trim($this->getApplication()->in()); |
83 | 83 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->getApplication()->out('No database found.') |
100 | 100 | ->out('Creating the database...', false); |
101 | 101 | |
102 | - $this->db->setQuery('CREATE DATABASE ' . $this->db->quoteName($this->getApplication()->get('database.name'))) |
|
102 | + $this->db->setQuery('CREATE DATABASE '.$this->db->quoteName($this->getApplication()->get('database.name'))) |
|
103 | 103 | ->execute(); |
104 | 104 | |
105 | 105 | $this->db->select($this->getApplication()->get('database.name')); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | private function processSql() : InstallCommand |
164 | 164 | { |
165 | - $fName = APPROOT . '/etc/mysql.sql'; |
|
165 | + $fName = APPROOT.'/etc/mysql.sql'; |
|
166 | 166 | |
167 | 167 | if (!file_exists($fName)) |
168 | 168 | { |
@@ -90,8 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->cleanDatabase($tables); |
93 | - } |
|
94 | - catch (\RuntimeException $e) |
|
93 | + } catch (\RuntimeException $e) |
|
95 | 94 | { |
96 | 95 | // Check if the message is "Could not connect to database." Odds are, this means the DB isn't there or the server is down. |
97 | 96 | if (strpos($e->getMessage(), 'Could not connect to database.') !== false) |
@@ -105,8 +104,7 @@ discard block |
||
105 | 104 | $this->db->select($this->getApplication()->get('database.name')); |
106 | 105 | |
107 | 106 | $this->getApplication()->out('<info>Database created.</info>'); |
108 | - } |
|
109 | - else |
|
107 | + } else |
|
110 | 108 | { |
111 | 109 | throw $e; |
112 | 110 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Registers the service provider with a DI container. |
41 | 41 | * |
42 | - * @param Container $container The DI container. |
|
42 | + * @param \Joomla\DI\Container $container The DI container. |
|
43 | 43 | * |
44 | 44 | * @return void |
45 | 45 | */ |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Get the Analytics class service |
105 | 105 | * |
106 | - * @param Container $container The DI container. |
|
106 | + * @param \Joomla\DI\Container $container The DI container. |
|
107 | 107 | * |
108 | 108 | * @return Analytics |
109 | 109 | */ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | /** |
116 | 116 | * Get the Cache\ClearCommand class service |
117 | 117 | * |
118 | - * @param Container $container The DI container. |
|
118 | + * @param \Joomla\DI\Container $container The DI container. |
|
119 | 119 | * |
120 | 120 | * @return AppCommands\Cache\ClearCommand |
121 | 121 | */ |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Get the CLI application service |
134 | 134 | * |
135 | - * @param Container $container The DI container. |
|
135 | + * @param \Joomla\DI\Container $container The DI container. |
|
136 | 136 | * |
137 | - * @return CliApplication |
|
137 | + * @return \Joomla\StatsServer\CliApplication |
|
138 | 138 | */ |
139 | 139 | public function getCliApplicationService(Container $container) : CliApplication |
140 | 140 | { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | /** |
156 | 156 | * Get the CliInput class service |
157 | 157 | * |
158 | - * @param Container $container The DI container. |
|
158 | + * @param \Joomla\DI\Container $container The DI container. |
|
159 | 159 | * |
160 | 160 | * @return JoomlaApplication\Cli\CliInput |
161 | 161 | */ |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | /** |
168 | 168 | * Get the CliOutput class service |
169 | 169 | * |
170 | - * @param Container $container The DI container. |
|
170 | + * @param \Joomla\DI\Container $container The DI container. |
|
171 | 171 | * |
172 | 172 | * @return JoomlaApplication\Cli\CliOutput |
173 | 173 | */ |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | /** |
180 | 180 | * Get the ColorProcessor class service |
181 | 181 | * |
182 | - * @param Container $container The DI container. |
|
182 | + * @param \Joomla\DI\Container $container The DI container. |
|
183 | 183 | * |
184 | 184 | * @return JoomlaApplication\Cli\Output\Processor\ColorProcessor |
185 | 185 | */ |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | /** |
205 | 205 | * Get the console service |
206 | 206 | * |
207 | - * @param Container $container The DI container. |
|
207 | + * @param \Joomla\DI\Container $container The DI container. |
|
208 | 208 | * |
209 | - * @return Console |
|
209 | + * @return \Joomla\StatsServer\Console |
|
210 | 210 | */ |
211 | 211 | public function getConsoleService(Container $container) : Console |
212 | 212 | { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | /** |
220 | 220 | * Get the Database\MigrateCommand class service |
221 | 221 | * |
222 | - * @param Container $container The DI container. |
|
222 | + * @param \Joomla\DI\Container $container The DI container. |
|
223 | 223 | * |
224 | 224 | * @return AppCommands\Database\MigrateCommand |
225 | 225 | */ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Get the Database\StatusCommand class service |
239 | 239 | * |
240 | - * @param Container $container The DI container. |
|
240 | + * @param \Joomla\DI\Container $container The DI container. |
|
241 | 241 | * |
242 | 242 | * @return AppCommands\Database\StatusCommand |
243 | 243 | */ |
@@ -254,9 +254,9 @@ discard block |
||
254 | 254 | /** |
255 | 255 | * Get the DisplayControllerGet class service |
256 | 256 | * |
257 | - * @param Container $container The DI container. |
|
257 | + * @param \Joomla\DI\Container $container The DI container. |
|
258 | 258 | * |
259 | - * @return DisplayControllerGet |
|
259 | + * @return \Joomla\StatsServer\Controllers\DisplayControllerGet |
|
260 | 260 | */ |
261 | 261 | public function getDisplayControllerGetService(Container $container) : DisplayControllerGet |
262 | 262 | { |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | /** |
275 | 275 | * Get the HelpCommand class service |
276 | 276 | * |
277 | - * @param Container $container The DI container. |
|
277 | + * @param \Joomla\DI\Container $container The DI container. |
|
278 | 278 | * |
279 | 279 | * @return AppCommands\HelpCommand |
280 | 280 | */ |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | /** |
292 | 292 | * Get the Input\Cli class service |
293 | 293 | * |
294 | - * @param Container $container The DI container. |
|
294 | + * @param \Joomla\DI\Container $container The DI container. |
|
295 | 295 | * |
296 | - * @return Cli |
|
296 | + * @return \Joomla\Input\Cli |
|
297 | 297 | */ |
298 | 298 | public function getInputCliService(Container $container) : Cli |
299 | 299 | { |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | /** |
304 | 304 | * Get the Input class service |
305 | 305 | * |
306 | - * @param Container $container The DI container. |
|
306 | + * @param \Joomla\DI\Container $container The DI container. |
|
307 | 307 | * |
308 | - * @return Input |
|
308 | + * @return \Joomla\Input\Input |
|
309 | 309 | */ |
310 | 310 | public function getInputService(Container $container) : Input |
311 | 311 | { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | /** |
316 | 316 | * Get the InstallCommand class service |
317 | 317 | * |
318 | - * @param Container $container The DI container. |
|
318 | + * @param \Joomla\DI\Container $container The DI container. |
|
319 | 319 | * |
320 | 320 | * @return AppCommands\InstallCommand |
321 | 321 | */ |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | /** |
333 | 333 | * Get the router service |
334 | 334 | * |
335 | - * @param Container $container The DI container. |
|
335 | + * @param \Joomla\DI\Container $container The DI container. |
|
336 | 336 | * |
337 | - * @return Router |
|
337 | + * @return \Joomla\StatsServer\Router |
|
338 | 338 | */ |
339 | 339 | public function getRouterService(Container $container) : Router |
340 | 340 | { |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | /** |
353 | 353 | * Get the SnapshotCommand class service |
354 | 354 | * |
355 | - * @param Container $container The DI container. |
|
355 | + * @param \Joomla\DI\Container $container The DI container. |
|
356 | 356 | * |
357 | 357 | * @return AppCommands\SnapshotCommand |
358 | 358 | */ |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | /** |
370 | 370 | * Get the StatsJsonView class service |
371 | 371 | * |
372 | - * @param Container $container The DI container. |
|
372 | + * @param \Joomla\DI\Container $container The DI container. |
|
373 | 373 | * |
374 | 374 | * @return StatsJsonView |
375 | 375 | */ |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | /** |
384 | 384 | * Get the StatsModel class service |
385 | 385 | * |
386 | - * @param Container $container The DI container. |
|
386 | + * @param \Joomla\DI\Container $container The DI container. |
|
387 | 387 | * |
388 | 388 | * @return StatsModel |
389 | 389 | */ |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | /** |
398 | 398 | * Get the SubmitControllerCreate class service |
399 | 399 | * |
400 | - * @param Container $container The DI container. |
|
400 | + * @param \Joomla\DI\Container $container The DI container. |
|
401 | 401 | * |
402 | - * @return SubmitControllerCreate |
|
402 | + * @return \Joomla\StatsServer\Controllers\SubmitControllerCreate |
|
403 | 403 | */ |
404 | 404 | public function getSubmitControllerCreateService(Container $container) : SubmitControllerCreate |
405 | 405 | { |
@@ -416,9 +416,9 @@ discard block |
||
416 | 416 | /** |
417 | 417 | * Get the SubmitControllerGet class service |
418 | 418 | * |
419 | - * @param Container $container The DI container. |
|
419 | + * @param \Joomla\DI\Container $container The DI container. |
|
420 | 420 | * |
421 | - * @return SubmitControllerGet |
|
421 | + * @return \Joomla\StatsServer\Controllers\SubmitControllerGet |
|
422 | 422 | */ |
423 | 423 | public function getSubmitControllerGetService(Container $container) : SubmitControllerGet |
424 | 424 | { |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | /** |
434 | 434 | * Get the Tags\JoomlaCommand class service |
435 | 435 | * |
436 | - * @param Container $container The DI container. |
|
436 | + * @param \Joomla\DI\Container $container The DI container. |
|
437 | 437 | * |
438 | 438 | * @return AppCommands\Tags\JoomlaCommand |
439 | 439 | */ |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | /** |
451 | 451 | * Get the Tags\PhpCommand class service |
452 | 452 | * |
453 | - * @param Container $container The DI container. |
|
453 | + * @param \Joomla\DI\Container $container The DI container. |
|
454 | 454 | * |
455 | 455 | * @return AppCommands\Tags\PhpCommand |
456 | 456 | */ |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | /** |
468 | 468 | * Get the UpdateCommand class service |
469 | 469 | * |
470 | - * @param Container $container The DI container. |
|
470 | + * @param \Joomla\DI\Container $container The DI container. |
|
471 | 471 | * |
472 | 472 | * @return AppCommands\UpdateCommand |
473 | 473 | */ |
@@ -484,9 +484,9 @@ discard block |
||
484 | 484 | /** |
485 | 485 | * Get the web application service |
486 | 486 | * |
487 | - * @param Container $container The DI container. |
|
487 | + * @param \Joomla\DI\Container $container The DI container. |
|
488 | 488 | * |
489 | - * @return WebApplication |
|
489 | + * @return \Joomla\StatsServer\WebApplication |
|
490 | 490 | */ |
491 | 491 | public function getWebApplicationService(Container $container) : WebApplication |
492 | 492 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * Registers the service provider with a DI container. |
48 | 48 | * |
49 | - * @param Container $container The DI container. |
|
49 | + * @param \Joomla\DI\Container $container The DI container. |
|
50 | 50 | * |
51 | 51 | * @return void |
52 | 52 | */ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Get the `config` service |
60 | 60 | * |
61 | - * @param Container $container The DI container. |
|
61 | + * @param \Joomla\DI\Container $container The DI container. |
|
62 | 62 | * |
63 | 63 | * @return Registry |
64 | 64 | */ |