@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function __get($name) |
25 | 25 | { |
26 | - $class = __NAMESPACE__ . '\\' . $this->package . '\\' . ucfirst($name); |
|
26 | + $class = __NAMESPACE__.'\\'.$this->package.'\\'.ucfirst($name); |
|
27 | 27 | |
28 | 28 | if (class_exists($class)) |
29 | 29 | { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public function getTags($owner, $repo, $page = 0) |
50 | 50 | { |
51 | 51 | // Build the request path. |
52 | - $path = '/repos/' . $owner . '/' . $repo . '/tags'; |
|
52 | + $path = '/repos/'.$owner.'/'.$repo.'/tags'; |
|
53 | 53 | |
54 | 54 | // Send the request. |
55 | 55 | $this->apiResponse = $this->client->get($this->fetchUrl($path, $page)); |
@@ -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( |
@@ -56,11 +56,11 @@ |
||
56 | 56 | else |
57 | 57 | { |
58 | 58 | $this->getApplication()->out( |
59 | - '<comment>' . sprintf('Your database is not up-to-date. You are missing %d migrations.', $status['missingMigrations']) . '</comment>' |
|
59 | + '<comment>'.sprintf('Your database is not up-to-date. You are missing %d migrations.', $status['missingMigrations']).'</comment>' |
|
60 | 60 | ) |
61 | 61 | ->out() |
62 | - ->out('<comment>' . sprintf('Current Version: %1$s', $status['currentVersion']) . '</comment>') |
|
63 | - ->out('<comment>' . sprintf('Latest Version: %1$s', $status['latestVersion']) . '</comment>') |
|
62 | + ->out('<comment>'.sprintf('Current Version: %1$s', $status['currentVersion']).'</comment>') |
|
63 | + ->out('<comment>'.sprintf('Latest Version: %1$s', $status['latestVersion']).'</comment>') |
|
64 | 64 | ->out() |
65 | 65 | ->out(sprintf('To update, run the <fg=magenta>%1$s</fg=magenta> command.', 'database:migrate')); |
66 | 66 | } |
@@ -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"; |
@@ -55,7 +55,7 @@ discard block |
||
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 |
||
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 |
||
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 | { |
@@ -161,7 +161,7 @@ |
||
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 | { |
@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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 |
||
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 | { |
@@ -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 | } |
@@ -3,7 +3,6 @@ |
||
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 | /** |
@@ -30,12 +30,12 @@ |
||
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 |