Completed
Pull Request — master (#29)
by Michael
03:32
created
src/Database/Migrations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
 	 */
162 162
 	private function doMigration($version)
163 163
 	{
164
-		$sqlFile = 'migrations/' . $version . '.sql';
164
+		$sqlFile = 'migrations/'.$version.'.sql';
165 165
 
166 166
 		if (!$this->filesystem->has($sqlFile))
167 167
 		{
Please login to merge, or discard this patch.
src/Providers/DatabaseServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$container->alias('db', DatabaseDriver::class)
31 31
 			->share(
32 32
 				DatabaseDriver::class,
33
-				function (Container $container)
33
+				function(Container $container)
34 34
 				{
35 35
 					/** @var \Joomla\Registry\Registry $config */
36 36
 					$config = $container->get('config');
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 
47 47
 		$container->alias('db.migrations', Migrations::class)
48 48
 			->set(Migrations::class,
49
-			function (Container $container)
49
+			function(Container $container)
50 50
 			{
51 51
 				return new Migrations(
52 52
 					$container->get('db'),
53
-					new Filesystem(new Local(APPROOT . '/etc'))
53
+					new Filesystem(new Local(APPROOT.'/etc'))
54 54
 				);
55 55
 			}, true, true
56 56
 		);
Please login to merge, or discard this patch.
src/Commands/InstallCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 					->out('1) Yes')
63 63
 					->out('2) No')
64 64
 					->out()
65
-					->out('<question>' . g11n3t('Select:') . '</question>', false);
65
+					->out('<question>'.g11n3t('Select:').'</question>', false);
66 66
 
67 67
 				$in = trim($this->getApplication()->in());
68 68
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 				$this->out('No database found.')
85 85
 					->out('Creating the database...', false);
86 86
 
87
-				$this->db->setQuery('CREATE DATABASE ' . $this->db->quoteName($this->getApplication()->get('database.name')))
87
+				$this->db->setQuery('CREATE DATABASE '.$this->db->quoteName($this->getApplication()->get('database.name')))
88 88
 					->execute();
89 89
 
90 90
 				$this->db->select($this->getApplication()->get('database.name'));
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			$dbType = 'mysql';
153 153
 		}
154 154
 
155
-		$fName = APPROOT . '/etc/' . $dbType . '.sql';
155
+		$fName = APPROOT.'/etc/'.$dbType.'.sql';
156 156
 
157 157
 		if (!file_exists($fName))
158 158
 		{
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
src/Commands/UpdateCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Stats\Commands;
4 4
 
5 5
 use Joomla\Controller\AbstractController;
6
-use Joomla\Database\DatabaseDriver;
7 6
 use Stats\CommandInterface;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
 		$this->getApplication()->out('<info>Updating server to git HEAD</info>');
31 31
 
32 32
 		// Pull from remote repo
33
-		$this->runCommand('cd ' . APPROOT . ' && git pull 2>&1');
33
+		$this->runCommand('cd '.APPROOT.' && git pull 2>&1');
34 34
 
35 35
 		$this->getApplication()->out('<info>Updating Composer resources</info>');
36 36
 
37 37
 		// Run Composer install
38
-		$this->runCommand('cd ' . APPROOT . ' && composer install --no-dev -o 2>&1');
38
+		$this->runCommand('cd '.APPROOT.' && composer install --no-dev -o 2>&1');
39 39
 
40 40
 		$this->getApplication()->out('<info>Update complete</info>');
41 41
 
Please login to merge, or discard this patch.
src/Commands/Cache/ClearCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
src/Commands/Tags/JoomlaCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,15 +87,15 @@
 block discarded – undo
87 87
 
88 88
 			// Allow the next patch release after this one
89 89
 			$nextPatch = $explodedVersion[2] + 1;
90
-			$versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch;
90
+			$versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch;
91 91
 
92 92
 			// And allow the next minor release after this one
93 93
 			$nextMinor = $explodedVersion[1] + 1;
94
-			$versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0';
94
+			$versions[] = $explodedVersion[0].'.'.$nextMinor.'.0';
95 95
 		}
96 96
 
97 97
 		// Store the version data now
98
-		$path = APPROOT . '/versions/joomla.json';
98
+		$path = APPROOT.'/versions/joomla.json';
99 99
 
100 100
 		if (file_put_contents($path, json_encode($versions)) === false)
101 101
 		{
Please login to merge, or discard this patch.
src/Commands/Tags/PhpCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@
 block discarded – undo
95 95
 
96 96
 			// Allow the next patch release after this one
97 97
 			$nextPatch = $explodedVersion[2] + 1;
98
-			$versions[] = $explodedVersion[0] . '.' . $explodedVersion[1] . '.' . $nextPatch;
98
+			$versions[] = $explodedVersion[0].'.'.$explodedVersion[1].'.'.$nextPatch;
99 99
 
100 100
 			// And allow the next minor release after this one
101 101
 			$nextMinor = $explodedVersion[1] + 1;
102
-			$versions[] = $explodedVersion[0] . '.' . $nextMinor . '.0';
102
+			$versions[] = $explodedVersion[0].'.'.$nextMinor.'.0';
103 103
 		}
104 104
 
105 105
 		// Store the version data now
106
-		$path = APPROOT . '/versions/php.json';
106
+		$path = APPROOT.'/versions/php.json';
107 107
 
108 108
 		if (file_put_contents($path, json_encode($versions)) === false)
109 109
 		{
Please login to merge, or discard this patch.
src/Controllers/SubmitControllerCreate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		}
156 156
 
157 157
 		// Import the valid release listing
158
-		$path = APPROOT . '/versions/joomla.json';
158
+		$path = APPROOT.'/versions/joomla.json';
159 159
 
160 160
 		if (!file_exists($path))
161 161
 		{
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		}
221 221
 
222 222
 		// Import the valid release listing
223
-		$path = APPROOT . '/versions/php.json';
223
+		$path = APPROOT.'/versions/php.json';
224 224
 
225 225
 		if (!file_exists($path))
226 226
 		{
Please login to merge, or discard this patch.
src/Providers/ApplicationServiceProvider.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class)
54 54
 			->share(
55 55
 				JoomlaApplication\AbstractCliApplication::class,
56
-				function (Container $container)
56
+				function(Container $container)
57 57
 				{
58 58
 					$application = new CliApplication(
59 59
 						$container->get(Cli::class),
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class)
75 75
 			->share(
76 76
 				JoomlaApplication\AbstractWebApplication::class,
77
-				function (Container $container)
77
+				function(Container $container)
78 78
 				{
79 79
 					$application = new WebApplication($container->get(Input::class), $container->get('config'));
80 80
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 		$container->share(
92 92
 			Input::class,
93
-			function ()
93
+			function()
94 94
 			{
95 95
 				return new Input($_REQUEST);
96 96
 			},
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$container->share(
101 101
 			Cli::class,
102
-			function ()
102
+			function()
103 103
 			{
104 104
 				return new Cli;
105 105
 			},
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 		$container->share(
110 110
 			Console::class,
111
-			function (Container $container)
111
+			function(Container $container)
112 112
 			{
113 113
 				$console = new Console;
114 114
 				$console->setContainer($container);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$container->share(
121 121
 			JoomlaApplication\Cli\Output\Processor\ColorProcessor::class,
122
-			function (Container $container)
122
+			function(Container $container)
123 123
 			{
124 124
 				$processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor;
125 125
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		$container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class)
142 142
 			->share(
143 143
 				JoomlaApplication\Cli\Output\Stdout::class,
144
-				function (Container $container)
144
+				function(Container $container)
145 145
 				{
146 146
 					return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class));
147 147
 				}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		$container->share(
151 151
 			Analytics::class,
152
-			function ()
152
+			function()
153 153
 			{
154 154
 				return new Analytics(true);
155 155
 			}
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 		$container->share(
159 159
 			Router::class,
160
-			function (Container $container)
160
+			function(Container $container)
161 161
 			{
162 162
 				$router = (new Router($container->get(Input::class)))
163 163
 					->setContainer($container)
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 		$container->share(
175 175
 			HelpCommand::class,
176
-			function (Container $container)
176
+			function(Container $container)
177 177
 			{
178 178
 				$command = new HelpCommand;
179 179
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 		$container->share(
189 189
 			InstallCommand::class,
190
-			function (Container $container)
190
+			function(Container $container)
191 191
 			{
192 192
 				$command = new InstallCommand($container->get(DatabaseDriver::class));
193 193
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 		$container->share(
203 203
 			SnapshotCommand::class,
204
-			function (Container $container)
204
+			function(Container $container)
205 205
 			{
206 206
 				$command = new SnapshotCommand($container->get(StatsJsonView::class));
207 207
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$container->share(
217 217
 			UpdateCommand::class,
218
-			function (Container $container)
218
+			function(Container $container)
219 219
 			{
220 220
 				$command = new UpdateCommand;
221 221
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 		$container->share(
231 231
 			ClearCommand::class,
232
-			function (Container $container)
232
+			function(Container $container)
233 233
 			{
234 234
 				$command = new ClearCommand($container->get(Cache::class));
235 235
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
 		$container->share(
245 245
 			MigrateCommand::class,
246
-			function (Container $container)
246
+			function(Container $container)
247 247
 			{
248 248
 				$command = new MigrateCommand($container->get(Migrations::class));
249 249
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 		$container->share(
260 260
 			StatusCommand::class,
261
-			function (Container $container)
261
+			function(Container $container)
262 262
 			{
263 263
 				$command = new StatusCommand($container->get(Migrations::class));
264 264
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 		$container->share(
274 274
 			JoomlaCommand::class,
275
-			function (Container $container)
275
+			function(Container $container)
276 276
 			{
277 277
 				$command = new JoomlaCommand($container->get(GitHub::class));
278 278
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
 		$container->share(
288 288
 			PhpCommand::class,
289
-			function (Container $container)
289
+			function(Container $container)
290 290
 			{
291 291
 				$command = new PhpCommand($container->get(GitHub::class));
292 292
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
 		$container->share(
302 302
 			DisplayControllerGet::class,
303
-			function (Container $container)
303
+			function(Container $container)
304 304
 			{
305 305
 				$controller = new DisplayControllerGet(
306 306
 					$container->get(StatsJsonView::class),
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
 		$container->share(
319 319
 			SubmitControllerCreate::class,
320
-			function (Container $container)
320
+			function(Container $container)
321 321
 			{
322 322
 				$controller = new SubmitControllerCreate(
323 323
 					$container->get(StatsModel::class)
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
 		$container->share(
335 335
 			SubmitControllerGet::class,
336
-			function (Container $container)
336
+			function(Container $container)
337 337
 			{
338 338
 				$controller = new SubmitControllerGet;
339 339
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
 		$container->share(
349 349
 			StatsModel::class,
350
-			function (Container $container)
350
+			function(Container $container)
351 351
 			{
352 352
 				return new StatsModel(
353 353
 					$container->get(DatabaseDriver::class)
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
 		$container->share(
360 360
 			StatsJsonView::class,
361
-			function (Container $container)
361
+			function(Container $container)
362 362
 			{
363 363
 				return new StatsJsonView(
364 364
 					$container->get(StatsModel::class)
Please login to merge, or discard this patch.