Completed
Push — mysql_improvements ( f18046...2023bf )
by Michael
07:26 queued 04:23
created
src/Console.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,7 @@
 block discarded – undo
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";
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		$commands = [];
56 56
 
57 57
 		/** @var \DirectoryIterator $fileInfo */
58
-		foreach (new \DirectoryIterator(__DIR__ . '/Commands') as $fileInfo)
58
+		foreach (new \DirectoryIterator(__DIR__.'/Commands') as $fileInfo)
59 59
 		{
60 60
 			if ($fileInfo->isDot())
61 61
 			{
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 					}
76 76
 
77 77
 					$command   = $subFileInfo->getBasename('.php');
78
-					$className = __NAMESPACE__ . "\\Commands\\$namespace\\$command";
78
+					$className = __NAMESPACE__."\\Commands\\$namespace\\$command";
79 79
 
80 80
 					if (!class_exists($className))
81 81
 					{
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
 					// If the class isn't instantiable, it isn't a valid command
86 86
 					if ((new \ReflectionClass($className))->isInstantiable())
87 87
 					{
88
-						$commands[strtolower("$namespace:" . str_replace('Command', '', $command))] = $this->getContainer()->get($className);
88
+						$commands[strtolower("$namespace:".str_replace('Command', '', $command))] = $this->getContainer()->get($className);
89 89
 					}
90 90
 				}
91 91
 			}
92 92
 			else
93 93
 			{
94 94
 				$command   = $fileInfo->getBasename('.php');
95
-				$className = __NAMESPACE__ . "\\Commands\\$command";
95
+				$className = __NAMESPACE__."\\Commands\\$command";
96 96
 
97 97
 				if (!class_exists($className))
98 98
 				{
Please login to merge, or discard this patch.
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/Providers/ApplicationServiceProvider.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class)
53 53
 			->share(
54 54
 				JoomlaApplication\AbstractCliApplication::class,
55
-				function (Container $container)
55
+				function(Container $container)
56 56
 				{
57 57
 					$application = new CliApplication(
58 58
 						$container->get(Cli::class),
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		$container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class)
74 74
 			->share(
75 75
 				JoomlaApplication\AbstractWebApplication::class,
76
-				function (Container $container)
76
+				function(Container $container)
77 77
 				{
78 78
 					$application = new WebApplication($container->get(Input::class), $container->get('config'));
79 79
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		$container->share(
91 91
 			Input::class,
92
-			function ()
92
+			function()
93 93
 			{
94 94
 				return new Input($_REQUEST);
95 95
 			},
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 		$container->share(
100 100
 			Cli::class,
101
-			function ()
101
+			function()
102 102
 			{
103 103
 				return new Cli;
104 104
 			},
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 		$container->share(
109 109
 			Console::class,
110
-			function (Container $container)
110
+			function(Container $container)
111 111
 			{
112 112
 				$console = new Console;
113 113
 				$console->setContainer($container);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 		$container->share(
120 120
 			JoomlaApplication\Cli\Output\Processor\ColorProcessor::class,
121
-			function (Container $container)
121
+			function(Container $container)
122 122
 			{
123 123
 				$processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor;
124 124
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		$container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class)
141 141
 			->share(
142 142
 				JoomlaApplication\Cli\Output\Stdout::class,
143
-				function (Container $container)
143
+				function(Container $container)
144 144
 				{
145 145
 					return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class));
146 146
 				}
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$container->share(
150 150
 			Analytics::class,
151
-			function ()
151
+			function()
152 152
 			{
153 153
 				return new Analytics(true);
154 154
 			}
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 		$container->share(
158 158
 			Router::class,
159
-			function (Container $container)
159
+			function(Container $container)
160 160
 			{
161 161
 				$router = (new Router($container->get(Input::class)))
162 162
 					->setContainer($container)
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 		$container->share(
174 174
 			HelpCommand::class,
175
-			function (Container $container)
175
+			function(Container $container)
176 176
 			{
177 177
 				$command = new HelpCommand;
178 178
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 		$container->share(
188 188
 			InstallCommand::class,
189
-			function (Container $container)
189
+			function(Container $container)
190 190
 			{
191 191
 				$command = new InstallCommand($container->get(DatabaseDriver::class));
192 192
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
 		$container->share(
202 202
 			SnapshotCommand::class,
203
-			function (Container $container)
203
+			function(Container $container)
204 204
 			{
205 205
 				$command = new SnapshotCommand($container->get(StatsJsonView::class));
206 206
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
 		$container->share(
216 216
 			UpdateCommand::class,
217
-			function (Container $container)
217
+			function(Container $container)
218 218
 			{
219 219
 				$command = new UpdateCommand;
220 220
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 		$container->share(
230 230
 			ClearCommand::class,
231
-			function (Container $container)
231
+			function(Container $container)
232 232
 			{
233 233
 				$command = new ClearCommand($container->get(Cache::class));
234 234
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 		$container->share(
244 244
 			MigrateCommand::class,
245
-			function (Container $container)
245
+			function(Container $container)
246 246
 			{
247 247
 				$command = new MigrateCommand($container->get(Migrations::class));
248 248
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 		$container->share(
259 259
 			StatusCommand::class,
260
-			function (Container $container)
260
+			function(Container $container)
261 261
 			{
262 262
 				$command = new StatusCommand($container->get(Migrations::class));
263 263
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		$container->share(
273 273
 			JoomlaCommand::class,
274
-			function (Container $container)
274
+			function(Container $container)
275 275
 			{
276 276
 				$command = new JoomlaCommand($container->get(GitHub::class));
277 277
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
 		$container->share(
287 287
 			DisplayControllerGet::class,
288
-			function (Container $container)
288
+			function(Container $container)
289 289
 			{
290 290
 				$controller = new DisplayControllerGet(
291 291
 					$container->get(StatsJsonView::class),
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
 		$container->share(
304 304
 			SubmitControllerCreate::class,
305
-			function (Container $container)
305
+			function(Container $container)
306 306
 			{
307 307
 				$controller = new SubmitControllerCreate(
308 308
 					$container->get(StatsModel::class)
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
 		$container->share(
320 320
 			SubmitControllerGet::class,
321
-			function (Container $container)
321
+			function(Container $container)
322 322
 			{
323 323
 				$controller = new SubmitControllerGet;
324 324
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
 		$container->share(
334 334
 			StatsModel::class,
335
-			function (Container $container)
335
+			function(Container $container)
336 336
 			{
337 337
 				return new StatsModel(
338 338
 					$container->get(DatabaseDriver::class)
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
 		$container->share(
345 345
 			StatsJsonView::class,
346
-			function (Container $container)
346
+			function(Container $container)
347 347
 			{
348 348
 				return new StatsJsonView(
349 349
 					$container->get(StatsModel::class)
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.