| @@ -25,8 +25,7 @@ | ||
| 25 | 25 |  { | 
| 26 | 26 | $app = $container->get(Application::class); | 
| 27 | 27 | $app->execute(); | 
| 28 | -} | |
| 29 | -catch (\Exception $e) | |
| 28 | +} catch (\Exception $e) | |
| 30 | 29 |  { | 
| 31 | 30 | if (!headers_sent()) | 
| 32 | 31 |  	{ | 
| @@ -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 | } | 
| @@ -2,7 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Stats\Models; | 
| 4 | 4 | |
| 5 | -use Joomla\Database\Query\LimitableInterface; | |
| 6 | 5 | use Joomla\Model\AbstractDatabaseModel; | 
| 7 | 6 | |
| 8 | 7 | /** | 
| @@ -72,15 +72,13 @@ | ||
| 72 | 72 | if ($this->cache->contains($key)) | 
| 73 | 73 |  			{ | 
| 74 | 74 | $body = $this->cache->fetch($key); | 
| 75 | - } | |
| 76 | - else | |
| 75 | + } else | |
| 77 | 76 |  			{ | 
| 78 | 77 | $body = $this->view->render(); | 
| 79 | 78 | |
| 80 | 79 |  				$this->cache->save($key, $body, $this->getApplication()->get('cache.lifetime', 900)); | 
| 81 | 80 | } | 
| 82 | - } | |
| 83 | - else | |
| 81 | + } else | |
| 84 | 82 |  		{ | 
| 85 | 83 | $body = $this->view->render(); | 
| 86 | 84 | } | 
| @@ -8,7 +8,6 @@ | ||
| 8 | 8 | use Monolog\Logger; | 
| 9 | 9 | use Monolog\Processor\PsrLogMessageProcessor; | 
| 10 | 10 | use Monolog\Processor\WebProcessor; | 
| 11 | -use Psr\Log\LoggerInterface; | |
| 12 | 11 | |
| 13 | 12 | /** | 
| 14 | 13 | * Monolog service provider | 
| @@ -61,8 +61,7 @@ discard block | ||
| 61 | 61 | try | 
| 62 | 62 |  			{ | 
| 63 | 63 | $this->analytics->sendPageview(); | 
| 64 | - } | |
| 65 | - catch (\Exception $e) | |
| 64 | + } catch (\Exception $e) | |
| 66 | 65 |  			{ | 
| 67 | 66 | // Log the error for reference | 
| 68 | 67 | $this->getLogger()->error( | 
| @@ -75,8 +74,7 @@ discard block | ||
| 75 | 74 | try | 
| 76 | 75 |  		{ | 
| 77 | 76 |  			$this->router->getController($this->get('uri.route'))->execute(); | 
| 78 | - } | |
| 79 | - catch (\Exception $e) | |
| 77 | + } catch (\Exception $e) | |
| 80 | 78 |  		{ | 
| 81 | 79 | // Log the error for reference | 
| 82 | 80 | $this->getLogger()->error( | 
| @@ -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 | } | 
| @@ -57,8 +57,7 @@ | ||
| 57 | 57 | try | 
| 58 | 58 |  		{ | 
| 59 | 59 | $this->migrations->migrateDatabase($version); | 
| 60 | - } | |
| 61 | - catch (\Exception $exception) | |
| 60 | + } catch (\Exception $exception) | |
| 62 | 61 |  		{ | 
| 63 | 62 | $this->logger->critical( | 
| 64 | 63 | 'Error migrating database', | 
| @@ -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"; | 
| @@ -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 | } |