@@ -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 | |
@@ -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 | |
@@ -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 | } |
@@ -82,8 +82,7 @@ |
||
| 82 | 82 | try |
| 83 | 83 | { |
| 84 | 84 | $this->analytics->sendPageview(); |
| 85 | - } |
|
| 86 | - catch (\Exception $e) |
|
| 85 | + } catch (\Exception $e) |
|
| 87 | 86 | { |
| 88 | 87 | // Log the error for reference |
| 89 | 88 | $this->logger->error( |
@@ -132,8 +132,7 @@ |
||
| 132 | 132 | if ($recordExists) |
| 133 | 133 | { |
| 134 | 134 | $this->db->updateObject('#__jstats', $data, ['unique_id']); |
| 135 | - } |
|
| 136 | - else |
|
| 135 | + } else |
|
| 137 | 136 | { |
| 138 | 137 | $this->db->insertObject('#__jstats', $data, ['unique_id']); |
| 139 | 138 | } |
@@ -188,8 +188,7 @@ discard block |
||
| 188 | 188 | try |
| 189 | 189 | { |
| 190 | 190 | $validVersions = json_decode($this->filesystem->read('joomla.json'), true); |
| 191 | - } |
|
| 192 | - catch (FileNotFoundException $exception) |
|
| 191 | + } catch (FileNotFoundException $exception) |
|
| 193 | 192 | { |
| 194 | 193 | throw new \RuntimeException('Missing Joomla! release listing', 500, $exception); |
| 195 | 194 | } |
@@ -248,8 +247,7 @@ discard block |
||
| 248 | 247 | try |
| 249 | 248 | { |
| 250 | 249 | $validVersions = json_decode($this->filesystem->read('php.json'), true); |
| 251 | - } |
|
| 252 | - catch (FileNotFoundException $exception) |
|
| 250 | + } catch (FileNotFoundException $exception) |
|
| 253 | 251 | { |
| 254 | 252 | throw new \RuntimeException('Missing PHP release listing', 500, $exception); |
| 255 | 253 | } |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | ->select('version') |
| 65 | 65 | ->from('#__migrations') |
| 66 | 66 | )->loadColumn(); |
| 67 | - } |
|
| 68 | - catch (ExecutionFailureException | PrepareStatementFailureException $exception) |
|
| 67 | + } catch (ExecutionFailureException | PrepareStatementFailureException $exception) |
|
| 69 | 68 | { |
| 70 | 69 | // On PDO we're checking "42S02, 1146, Table 'XXX.#__migrations' doesn't exist" |
| 71 | 70 | if (strpos($exception->getMessage(), "migrations' doesn't exist") === false) |
@@ -132,8 +131,7 @@ discard block |
||
| 132 | 131 | ->select('version') |
| 133 | 132 | ->from('#__migrations') |
| 134 | 133 | )->loadColumn(); |
| 135 | - } |
|
| 136 | - catch (ExecutionFailureException | PrepareStatementFailureException $exception) |
|
| 134 | + } catch (ExecutionFailureException | PrepareStatementFailureException $exception) |
|
| 137 | 135 | { |
| 138 | 136 | // If the table does not exist, we can still try to run migrations |
| 139 | 137 | if (strpos($exception->getMessage(), "migrations' doesn't exist") === false) |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | try |
| 58 | 58 | { |
| 59 | 59 | $processHelper->mustRun($output, new Process(['git', 'pull'], APPROOT)); |
| 60 | - } |
|
| 61 | - catch (ProcessFailedException $e) |
|
| 60 | + } catch (ProcessFailedException $e) |
|
| 62 | 61 | { |
| 63 | 62 | $this->getApplication()->getLogger()->error('Could not execute `git pull`', ['exception' => $e]); |
| 64 | 63 | |
@@ -73,8 +72,7 @@ discard block |
||
| 73 | 72 | try |
| 74 | 73 | { |
| 75 | 74 | $processHelper->mustRun($output, new Process(['composer', 'install', '--no-dev', '-o', '-a'], APPROOT)); |
| 76 | - } |
|
| 77 | - catch (ProcessFailedException $e) |
|
| 75 | + } catch (ProcessFailedException $e) |
|
| 78 | 76 | { |
| 79 | 77 | $this->getApplication()->getLogger()->error('Could not update Composer resources', ['exception' => $e]); |
| 80 | 78 | |