| @@ -27,7 +27,7 @@ | ||
| 27 | 27 |  		$container->alias('db', DatabaseDriver::class) | 
| 28 | 28 | ->share( | 
| 29 | 29 | DatabaseDriver::class, | 
| 30 | - function (Container $container) | |
| 30 | + function(Container $container) | |
| 31 | 31 |  				{ | 
| 32 | 32 |  					$config = $container->get('config'); | 
| 33 | 33 | |
| @@ -53,7 +53,7 @@ | ||
| 53 | 53 |  	{ | 
| 54 | 54 | $container->share( | 
| 55 | 55 | 'config', | 
| 56 | - function () | |
| 56 | + function() | |
| 57 | 57 |  			{ | 
| 58 | 58 | return $this->config; | 
| 59 | 59 | }, | 
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | $container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class) | 
| 43 | 43 | ->share( | 
| 44 | 44 | JoomlaApplication\AbstractCliApplication::class, | 
| 45 | - function (Container $container) | |
| 45 | + function(Container $container) | |
| 46 | 46 |  				{ | 
| 47 | 47 | $application = new CliApplication( | 
| 48 | 48 | $container->get(Cli::class), | 
| @@ -63,7 +63,7 @@ discard block | ||
| 63 | 63 | $container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class) | 
| 64 | 64 | ->share( | 
| 65 | 65 | JoomlaApplication\AbstractWebApplication::class, | 
| 66 | - function (Container $container) | |
| 66 | + function(Container $container) | |
| 67 | 67 |  				{ | 
| 68 | 68 |  					$application = new WebApplication($container->get(Input::class), $container->get('config')); | 
| 69 | 69 | |
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | |
| 79 | 79 | $container->share( | 
| 80 | 80 | Input::class, | 
| 81 | - function () | |
| 81 | + function() | |
| 82 | 82 |  			{ | 
| 83 | 83 | return new Input($_REQUEST); | 
| 84 | 84 | }, | 
| @@ -87,7 +87,7 @@ discard block | ||
| 87 | 87 | |
| 88 | 88 | $container->share( | 
| 89 | 89 | Cli::class, | 
| 90 | - function () | |
| 90 | + function() | |
| 91 | 91 |  			{ | 
| 92 | 92 | return new Cli; | 
| 93 | 93 | }, | 
| @@ -96,7 +96,7 @@ discard block | ||
| 96 | 96 | |
| 97 | 97 | $container->share( | 
| 98 | 98 | Console::class, | 
| 99 | - function (Container $container) | |
| 99 | + function(Container $container) | |
| 100 | 100 |  			{ | 
| 101 | 101 | $console = new Console; | 
| 102 | 102 | $console->setContainer($container); | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 | |
| 108 | 108 | $container->share( | 
| 109 | 109 | JoomlaApplication\Cli\Output\Processor\ColorProcessor::class, | 
| 110 | - function (Container $container) | |
| 110 | + function(Container $container) | |
| 111 | 111 |  			{ | 
| 112 | 112 | $processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor; | 
| 113 | 113 | |
| @@ -129,7 +129,7 @@ discard block | ||
| 129 | 129 | $container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class) | 
| 130 | 130 | ->share( | 
| 131 | 131 | JoomlaApplication\Cli\Output\Stdout::class, | 
| 132 | - function (Container $container) | |
| 132 | + function(Container $container) | |
| 133 | 133 |  				{ | 
| 134 | 134 | return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class)); | 
| 135 | 135 | } | 
| @@ -137,7 +137,7 @@ discard block | ||
| 137 | 137 | |
| 138 | 138 | $container->share( | 
| 139 | 139 | Router::class, | 
| 140 | - function (Container $container) | |
| 140 | + function(Container $container) | |
| 141 | 141 |  			{ | 
| 142 | 142 | $router = (new Router($container->get(Input::class))) | 
| 143 | 143 | ->setContainer($container) | 
| @@ -153,7 +153,7 @@ discard block | ||
| 153 | 153 | |
| 154 | 154 | $container->share( | 
| 155 | 155 | HelpCommand::class, | 
| 156 | - function (Container $container) | |
| 156 | + function(Container $container) | |
| 157 | 157 |  			{ | 
| 158 | 158 | $command = new HelpCommand; | 
| 159 | 159 | |
| @@ -167,7 +167,7 @@ discard block | ||
| 167 | 167 | |
| 168 | 168 | $container->share( | 
| 169 | 169 | SnapshotCommand::class, | 
| 170 | - function (Container $container) | |
| 170 | + function(Container $container) | |
| 171 | 171 |  			{ | 
| 172 | 172 | $command = new SnapshotCommand($container->get(StatsJsonView::class)); | 
| 173 | 173 | |
| @@ -181,7 +181,7 @@ discard block | ||
| 181 | 181 | |
| 182 | 182 | $container->share( | 
| 183 | 183 | DisplayControllerGet::class, | 
| 184 | - function (Container $container) | |
| 184 | + function(Container $container) | |
| 185 | 185 |  			{ | 
| 186 | 186 | $controller = new DisplayControllerGet( | 
| 187 | 187 | $container->get(StatsJsonView::class), | 
| @@ -198,7 +198,7 @@ discard block | ||
| 198 | 198 | |
| 199 | 199 | $container->share( | 
| 200 | 200 | SubmitControllerCreate::class, | 
| 201 | - function (Container $container) | |
| 201 | + function(Container $container) | |
| 202 | 202 |  			{ | 
| 203 | 203 | $controller = new SubmitControllerCreate( | 
| 204 | 204 | $container->get(StatsModel::class) | 
| @@ -214,7 +214,7 @@ discard block | ||
| 214 | 214 | |
| 215 | 215 | $container->share( | 
| 216 | 216 | SubmitControllerGet::class, | 
| 217 | - function (Container $container) | |
| 217 | + function(Container $container) | |
| 218 | 218 |  			{ | 
| 219 | 219 | $controller = new SubmitControllerGet; | 
| 220 | 220 | |
| @@ -228,7 +228,7 @@ discard block | ||
| 228 | 228 | |
| 229 | 229 | $container->share( | 
| 230 | 230 | StatsModel::class, | 
| 231 | - function (Container $container) | |
| 231 | + function(Container $container) | |
| 232 | 232 |  			{ | 
| 233 | 233 | return new StatsModel( | 
| 234 | 234 | $container->get(DatabaseDriver::class) | 
| @@ -239,7 +239,7 @@ discard block | ||
| 239 | 239 | |
| 240 | 240 | $container->share( | 
| 241 | 241 | StatsJsonView::class, | 
| 242 | - function (Container $container) | |
| 242 | + function(Container $container) | |
| 243 | 243 |  			{ | 
| 244 | 244 | return new StatsJsonView( | 
| 245 | 245 | $container->get(StatsModel::class) | 
| @@ -2,11 +2,11 @@ | ||
| 2 | 2 | |
| 3 | 3 | const APPROOT = __DIR__; | 
| 4 | 4 | |
| 5 | -$composerPath = APPROOT . '/vendor/autoload.php'; | |
| 5 | +$composerPath = APPROOT.'/vendor/autoload.php'; | |
| 6 | 6 | |
| 7 | 7 | if (!file_exists($composerPath)) | 
| 8 | 8 |  { | 
| 9 | 9 |  	throw new RuntimeException('Composer is not set up, please run "composer install".'); | 
| 10 | 10 | } | 
| 11 | 11 | |
| 12 | -require APPROOT . '/vendor/autoload.php'; | |
| 12 | +require APPROOT.'/vendor/autoload.php'; | |
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -require dirname(__DIR__) . '/boot.php'; | |
| 3 | +require dirname(__DIR__).'/boot.php'; | |
| 4 | 4 | |
| 5 | 5 | use Joomla\Application\AbstractApplication; | 
| 6 | 6 | use Joomla\Application\AbstractWebApplication; | 
| @@ -17,7 +17,7 @@ discard block | ||
| 17 | 17 | $container = (new Container) | 
| 18 | 18 | ->registerServiceProvider(new ApplicationServiceProvider) | 
| 19 | 19 | ->registerServiceProvider(new CacheServiceProvider) | 
| 20 | - ->registerServiceProvider(new ConfigServiceProvider(APPROOT . '/etc/config.json')) | |
| 20 | + ->registerServiceProvider(new ConfigServiceProvider(APPROOT.'/etc/config.json')) | |
| 21 | 21 | ->registerServiceProvider(new DatabaseServiceProvider) | 
| 22 | 22 | ->registerServiceProvider(new MonologServiceProvider); | 
| 23 | 23 | |
| @@ -48,7 +48,7 @@ discard block | ||
| 48 | 48 | |
| 49 | 49 | $response = [ | 
| 50 | 50 | 'error' => true, | 
| 51 | - 'message' => 'An error occurred while executing the application: ' . $e->getMessage() | |
| 51 | + 'message' => 'An error occurred while executing the application: '.$e->getMessage() | |
| 52 | 52 | ]; | 
| 53 | 53 | |
| 54 | 54 | echo json_encode($response); | 
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | // Register the PSR-3 processor | 
| 32 | 32 | $container->share( | 
| 33 | 33 | 'monolog.processor.psr3', | 
| 34 | - function () | |
| 34 | + function() | |
| 35 | 35 |  			{ | 
| 36 | 36 | return new PsrLogMessageProcessor; | 
| 37 | 37 | } | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | // Register the web processor | 
| 41 | 41 | $container->share( | 
| 42 | 42 | 'monolog.processor.web', | 
| 43 | - function () | |
| 43 | + function() | |
| 44 | 44 |  			{ | 
| 45 | 45 | return new WebProcessor; | 
| 46 | 46 | } | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | // Register the web application handler | 
| 50 | 50 | $container->share( | 
| 51 | 51 | 'monolog.handler.application', | 
| 52 | - function (Container $container) | |
| 52 | + function(Container $container) | |
| 53 | 53 |  			{ | 
| 54 | 54 | /** @var \Joomla\Registry\Registry $config */ | 
| 55 | 55 |  				$config = $container->get('config'); | 
| @@ -57,8 +57,8 @@ discard block | ||
| 57 | 57 |  				$level = strtoupper($config->get('log.application', $config->get('log.level', 'error'))); | 
| 58 | 58 | |
| 59 | 59 | return new StreamHandler( | 
| 60 | - APPROOT . '/logs/stats.log', | |
| 61 | -					constant('\\Monolog\\Logger::' . $level) | |
| 60 | + APPROOT.'/logs/stats.log', | |
| 61 | +					constant('\\Monolog\\Logger::'.$level) | |
| 62 | 62 | ); | 
| 63 | 63 | } | 
| 64 | 64 | ); | 
| @@ -66,7 +66,7 @@ discard block | ||
| 66 | 66 | // Register the database handler | 
| 67 | 67 | $container->share( | 
| 68 | 68 | 'monolog.handler.database', | 
| 69 | - function (Container $container) | |
| 69 | + function(Container $container) | |
| 70 | 70 |  			{ | 
| 71 | 71 | /** @var \Joomla\Registry\Registry $config */ | 
| 72 | 72 |  				$config = $container->get('config'); | 
| @@ -75,8 +75,8 @@ discard block | ||
| 75 | 75 |  				$level = $config->get('database.debug', false) ? 'DEBUG' : strtoupper($config->get('log.database', $config->get('log.level', 'error'))); | 
| 76 | 76 | |
| 77 | 77 | return new StreamHandler( | 
| 78 | - APPROOT . '/logs/stats.log', | |
| 79 | -					constant('\\Monolog\\Logger::' . $level) | |
| 78 | + APPROOT.'/logs/stats.log', | |
| 79 | +					constant('\\Monolog\\Logger::'.$level) | |
| 80 | 80 | ); | 
| 81 | 81 | } | 
| 82 | 82 | ); | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | // Register the web application Logger | 
| 85 | 85 | $container->share( | 
| 86 | 86 | 'monolog.logger.application', | 
| 87 | - function (Container $container) | |
| 87 | + function(Container $container) | |
| 88 | 88 |  			{ | 
| 89 | 89 | return new Logger( | 
| 90 | 90 | 'Application', | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | // Register the CLI application Logger | 
| 102 | 102 | $container->share( | 
| 103 | 103 | 'monolog.logger.cli', | 
| 104 | - function (Container $container) | |
| 104 | + function(Container $container) | |
| 105 | 105 |  			{ | 
| 106 | 106 | return new Logger( | 
| 107 | 107 | 'Application', | 
| @@ -115,7 +115,7 @@ discard block | ||
| 115 | 115 | // Register the database Logger | 
| 116 | 116 | $container->share( | 
| 117 | 117 | 'monolog.logger.database', | 
| 118 | - function (Container $container) | |
| 118 | + function(Container $container) | |
| 119 | 119 |  			{ | 
| 120 | 120 | return new Logger( | 
| 121 | 121 | 'Database', | 
| @@ -28,7 +28,7 @@ discard block | ||
| 28 | 28 |  		$container->alias('cache', CacheInterface::class) | 
| 29 | 29 | ->share( | 
| 30 | 30 | CacheInterface::class, | 
| 31 | - function (Container $container) | |
| 31 | + function(Container $container) | |
| 32 | 32 |  				{ | 
| 33 | 33 | /** @var \Joomla\Registry\Registry $config */ | 
| 34 | 34 |  					$config = $container->get('config'); | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | // If the path is relative, make it absolute | 
| 61 | 61 | if (substr($path, 0, 1) !== '/') | 
| 62 | 62 |  							{ | 
| 63 | - $path = APPROOT . '/' . $path; | |
| 63 | + $path = APPROOT.'/'.$path; | |
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | 66 | $handler = new Cache\FilesystemCache($path); | 
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 | // If the path is relative, make it absolute | 
| 80 | 80 | if (substr($path, 0, 1) !== '/') | 
| 81 | 81 |  							{ | 
| 82 | - $path = APPROOT . '/' . $path; | |
| 82 | + $path = APPROOT.'/'.$path; | |
| 83 | 83 | } | 
| 84 | 84 | |
| 85 | 85 | $handler = new Cache\PhpFileCache($path); | 
| @@ -67,7 +67,7 @@ | ||
| 67 | 67 | // Serve cached data if the cache layer is enabled and the raw data source is not requested | 
| 68 | 68 |  		if ($this->getApplication()->get('cache.enabled', false) && !$authorizedRaw) | 
| 69 | 69 |  		{ | 
| 70 | - $key = md5(get_class($this->view) . __METHOD__ . $source); | |
| 70 | + $key = md5(get_class($this->view).__METHOD__.$source); | |
| 71 | 71 | |
| 72 | 72 | if ($this->cache->contains($key)) | 
| 73 | 73 |  			{ | 
| @@ -91,11 +91,11 @@ | ||
| 91 | 91 | public function outputTitle($title, $subTitle = '', $width = 60) | 
| 92 | 92 |  	{ | 
| 93 | 93 |  		$this->out(str_repeat('-', $width)); | 
| 94 | -		$this->out(str_repeat(' ', $width / 2 - (strlen($title) / 2)) . '<title>' . $title . '</title>'); | |
| 94 | +		$this->out(str_repeat(' ', $width / 2 - (strlen($title) / 2)).'<title>'.$title.'</title>'); | |
| 95 | 95 | |
| 96 | 96 | if ($subTitle) | 
| 97 | 97 |  		{ | 
| 98 | -			$this->out(str_repeat(' ', $width / 2 - (strlen($subTitle) / 2)) . '<b>' . $subTitle . '</b>'); | |
| 98 | +			$this->out(str_repeat(' ', $width / 2 - (strlen($subTitle) / 2)).'<b>'.$subTitle.'</b>'); | |
| 99 | 99 | } | 
| 100 | 100 | |
| 101 | 101 |  		$this->out(str_repeat('-', $width)); |