@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | \define('APPROOT', \dirname(__DIR__)); |
11 | 11 | |
12 | 12 | // Ensure we've initialized Composer |
13 | -if (!file_exists(APPROOT . '/vendor/autoload.php')) |
|
13 | +if (!file_exists(APPROOT.'/vendor/autoload.php')) |
|
14 | 14 | { |
15 | 15 | header('HTTP/1.1 500 Internal Server Error', null, 500); |
16 | 16 | header('Content-Type: application/json; charset=utf-8'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | exit; |
27 | 27 | } |
28 | 28 | |
29 | -require APPROOT . '/vendor/autoload.php'; |
|
29 | +require APPROOT.'/vendor/autoload.php'; |
|
30 | 30 | |
31 | 31 | try |
32 | 32 | { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | echo \json_encode( |
46 | 46 | [ |
47 | 47 | 'code' => $throwable->getCode(), |
48 | - 'message' => 'An error occurred while executing the application: ' . $throwable->getMessage(), |
|
48 | + 'message' => 'An error occurred while executing the application: '.$throwable->getMessage(), |
|
49 | 49 | 'error' => true, |
50 | 50 | ] |
51 | 51 | ); |
@@ -31,8 +31,7 @@ |
||
31 | 31 | try |
32 | 32 | { |
33 | 33 | (new \Joomla\StatsServer\Kernel\WebKernel)->run(); |
34 | -} |
|
35 | -catch (\Throwable $throwable) |
|
34 | +} catch (\Throwable $throwable) |
|
36 | 35 | { |
37 | 36 | error_log($throwable); |
38 | 37 |
@@ -105,11 +105,11 @@ |
||
105 | 105 | |
106 | 106 | // Allow the next patch release after this one |
107 | 107 | $nextPatch = $explodedVersion[2] + 1; |
108 | - $versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch; |
|
108 | + $versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch; |
|
109 | 109 | |
110 | 110 | // And allow the next minor release after this one |
111 | 111 | $nextMinor = $explodedVersion[1] + 1; |
112 | - $versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0'; |
|
112 | + $versions[] = $explodedVersion[0].'.'.$nextMinor.'.0'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (!$this->filesystem->put('joomla.json', json_encode($versions))) |
@@ -117,14 +117,14 @@ |
||
117 | 117 | $explodedVersion = explode('.', $version); |
118 | 118 | |
119 | 119 | $nextPatch = $explodedVersion[2] + 1; |
120 | - $versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch; |
|
120 | + $versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | // Use $branch from the previous loop to allow the next minor version (PHP's master branch) |
124 | 124 | $explodedVersion = explode('.', $branch); |
125 | 125 | |
126 | 126 | $nextMinor = $explodedVersion[1] + 1; |
127 | - $nextRelease = $explodedVersion[0] . '.' . $nextMinor . '.0'; |
|
127 | + $nextRelease = $explodedVersion[0].'.'.$nextMinor.'.0'; |
|
128 | 128 | |
129 | 129 | if (!\in_array($nextRelease, $versions, true)) |
130 | 130 | { |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | $this->view->setSource($source); |
96 | 96 | |
97 | - $filename .= '_' . $source; |
|
97 | + $filename .= '_'.$source; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | if (!$this->filesystem->write($filename, $this->view->render())) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $source = $input->getOption('source'); |
80 | 80 | |
81 | - $filename = date('YmdHis') . '_recent'; |
|
81 | + $filename = date('YmdHis').'_recent'; |
|
82 | 82 | |
83 | 83 | if ($source) |
84 | 84 | { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $this->view->setSource($source); |
97 | 97 | |
98 | - $filename .= '_' . $source; |
|
98 | + $filename .= '_'.$source; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!$this->filesystem->write($filename, $this->view->render())) |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $this->getApplication()->getLogger()->error('Could not execute `git pull`', ['exception' => $e]); |
52 | 52 | |
53 | - $symfonyStyle->error('Error running `git pull`: ' . $e->getMessage()); |
|
53 | + $symfonyStyle->error('Error running `git pull`: '.$e->getMessage()); |
|
54 | 54 | |
55 | 55 | return 1; |
56 | 56 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $this->getApplication()->getLogger()->error('Could not update Composer resources', ['exception' => $e]); |
68 | 68 | |
69 | - $symfonyStyle->error('Error updating Composer resources: ' . $e->getMessage()); |
|
69 | + $symfonyStyle->error('Error updating Composer resources: '.$e->getMessage()); |
|
70 | 70 | |
71 | 71 | return 1; |
72 | 72 | } |
@@ -45,8 +45,7 @@ discard block |
||
45 | 45 | try |
46 | 46 | { |
47 | 47 | (new Process('git pull', APPROOT))->mustRun(); |
48 | - } |
|
49 | - catch (ProcessFailedException $e) |
|
48 | + } catch (ProcessFailedException $e) |
|
50 | 49 | { |
51 | 50 | $this->getApplication()->getLogger()->error('Could not execute `git pull`', ['exception' => $e]); |
52 | 51 | |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | try |
62 | 61 | { |
63 | 62 | (new Process('composer install --no-dev -o -a', APPROOT))->mustRun(); |
64 | - } |
|
65 | - catch (ProcessFailedException $e) |
|
63 | + } catch (ProcessFailedException $e) |
|
66 | 64 | { |
67 | 65 | $this->getApplication()->getLogger()->error('Could not update Composer resources', ['exception' => $e]); |
68 | 66 |
@@ -70,8 +70,7 @@ discard block |
||
70 | 70 | try |
71 | 71 | { |
72 | 72 | $this->migrations->migrateDatabase($version); |
73 | - } |
|
74 | - catch (\Exception $exception) |
|
73 | + } catch (\Exception $exception) |
|
75 | 74 | { |
76 | 75 | $this->logger->critical( |
77 | 76 | 'Error migrating database', |
@@ -86,8 +85,7 @@ discard block |
||
86 | 85 | if ($version) |
87 | 86 | { |
88 | 87 | $message = sprintf('Database migrated to version "%s".', $version); |
89 | - } |
|
90 | - else |
|
88 | + } else |
|
91 | 89 | { |
92 | 90 | $message = 'Database migrated to latest version.'; |
93 | 91 | } |
@@ -64,12 +64,10 @@ |
||
64 | 64 | if (!$status->tableExists) |
65 | 65 | { |
66 | 66 | $symfonyStyle->comment('The migrations table does not exist, run the "database:migrate" command to set up the database.'); |
67 | - } |
|
68 | - elseif ($status->latest) |
|
67 | + } elseif ($status->latest) |
|
69 | 68 | { |
70 | 69 | $symfonyStyle->success('Your database is up-to-date.'); |
71 | - } |
|
72 | - else |
|
70 | + } else |
|
73 | 71 | { |
74 | 72 | $symfonyStyle->comment(sprintf('Your database is not up-to-date. You are missing %d migration(s).', $status->missingMigrations)); |
75 | 73 |
@@ -268,7 +268,7 @@ |
||
268 | 268 | foreach ($dataGroup as $row) |
269 | 269 | { |
270 | 270 | $exploded = explode('.', $row['name']); |
271 | - $version = $exploded[0] . '.' . ($exploded[1] ?? '0'); |
|
271 | + $version = $exploded[0].'.'.($exploded[1] ?? '0'); |
|
272 | 272 | |
273 | 273 | // If the container does not exist, add it |
274 | 274 | if (!isset($counts[$version])) |
@@ -102,8 +102,7 @@ |
||
102 | 102 | if ($this->recent) |
103 | 103 | { |
104 | 104 | $items = $this->repository->getRecentlyUpdatedItems(); |
105 | - } |
|
106 | - else |
|
105 | + } else |
|
107 | 106 | { |
108 | 107 | $items = $this->repository->getItems($this->source); |
109 | 108 | } |