@@ -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 | { |
@@ -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 | } |
@@ -2,9 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Stats; |
| 4 | 4 | |
| 5 | -use Joomla\Application\Cli\ColorStyle; |
|
| 6 | -use Joomla\Application\Cli\Output\Processor\ColorProcessor; |
|
| 7 | -use Joomla\Controller\AbstractController; |
|
| 8 | 5 | use Joomla\DI\ContainerAwareInterface; |
| 9 | 6 | use Joomla\DI\ContainerAwareTrait; |
| 10 | 7 | |
@@ -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 |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | $controller = $this->router->getController($this->get('uri.route')); |
| 42 | 42 | $controller->execute(); |
| 43 | - } |
|
| 44 | - catch (\Exception $e) |
|
| 43 | + } catch (\Exception $e) |
|
| 45 | 44 | { |
| 46 | 45 | // Log the error for reference |
| 47 | 46 | $this->getLogger()->error( |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | yield $db->loadAssocList(); |
| 56 | - } |
|
| 57 | - else |
|
| 56 | + } else |
|
| 58 | 57 | { |
| 59 | 58 | // If fetching all data from the table, we need to break this down a fair bit otherwise we're going to run out of memory |
| 60 | 59 | $totalRecords = $db->setQuery( |
@@ -80,8 +79,7 @@ discard block |
||
| 80 | 79 | $query->setLimit($this->batchSize, $offset); |
| 81 | 80 | |
| 82 | 81 | $db->setQuery($query); |
| 83 | - } |
|
| 84 | - else |
|
| 82 | + } else |
|
| 85 | 83 | { |
| 86 | 84 | $db->setQuery($query, $offset, $this->batchSize); |
| 87 | 85 | } |
@@ -126,8 +124,7 @@ discard block |
||
| 126 | 124 | if ($recordExists) |
| 127 | 125 | { |
| 128 | 126 | $db->updateObject('#__jstats', $data, ['unique_id']); |
| 129 | - } |
|
| 130 | - else |
|
| 127 | + } else |
|
| 131 | 128 | { |
| 132 | 129 | $db->insertObject('#__jstats', $data, ['unique_id']); |
| 133 | 130 | } |
@@ -105,8 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | ${$source}['unknown']++; |
| 108 | - } |
|
| 109 | - else |
|
| 108 | + } else |
|
| 110 | 109 | { |
| 111 | 110 | if (!isset(${$source}[$item[$source]])) |
| 112 | 111 | { |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | } |
| 225 | 224 | |
| 226 | 225 | $data[$source]['unknown']++; |
| 227 | - } |
|
| 228 | - else |
|
| 226 | + } else |
|
| 229 | 227 | { |
| 230 | 228 | if (!isset($data[$source][$item[$source]])) |
| 231 | 229 | { |