Passed
Push — master ( 0d291e...8951fe )
by Gaetano
08:48
created
app/src/Command/CollationList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         $this->writeResults($results, $time);
49 49
 
50
-        return (int)$results['failed'];
50
+        return (int) $results['failed'];
51 51
     }
52 52
 
53 53
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         return $this->executeSqlAction(
61 61
             $instanceList,
62 62
             'Listing of collations',
63
-            function ($schemaManager, $instanceName) {
63
+            function($schemaManager, $instanceName) {
64 64
                 /** @var DatabaseSchemaManager $schemaManager */
65 65
                 return $schemaManager->getListCollationsSqlAction();
66 66
             }
Please login to merge, or discard this patch.
app/src/Command/DatabaseList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         $this->writeResults($results, $time);
49 49
 
50
-        return (int)$results['failed'];
50
+        return (int) $results['failed'];
51 51
     }
52 52
 
53 53
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         return $this->executeSqlAction(
61 61
             $instanceList,
62 62
             'Listing of databases',
63
-            function ($schemaManager, $instanceName) {
63
+            function($schemaManager, $instanceName) {
64 64
                 /** @var DatabaseSchemaManager $schemaManager */
65 65
                 return $schemaManager->getListDatabasesSqlAction();
66 66
             }
Please login to merge, or discard this patch.
app/src/Command/UserDrop.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         }
51 51
 
52 52
         $userToDropSpecs = [];
53
-        foreach($instanceList as $instanceName => $instanceSpecs) {
53
+        foreach ($instanceList as $instanceName => $instanceSpecs) {
54 54
             $userToDropSpecs[$instanceName] = [
55 55
                 'user' => $userName
56 56
             ];
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         $this->writeResults($results, $time);
66 66
 
67
-        return (int)$results['failed'];
67
+        return (int) $results['failed'];
68 68
     }
69 69
 
70 70
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         return $this->executeSqlAction(
80 80
             $instanceList,
81 81
             'Dropping of user',
82
-            function ($schemaManager, $instanceName) use ($userToDropSpecs, $ifExists) {
82
+            function($schemaManager, $instanceName) use ($userToDropSpecs, $ifExists) {
83 83
                 $dbConnectionSpec = $userToDropSpecs[$instanceName];
84 84
                 /** @var DatabaseSchemaManager $schemaManager */
85 85
                 return $schemaManager->getDropUserSqlAction(
Please login to merge, or discard this patch.
app/src/Command/InstanceList.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $result = $this->listInstances($instanceList);
38 38
 
39 39
         $extraResults = $this->listDatabasesVersion($instanceList)['data'];
40
-        foreach($result as $instanceName => $instanceDesc) {
40
+        foreach ($result as $instanceName => $instanceDesc) {
41 41
             if (isset($extraResults[$instanceName])) {
42 42
                 $result[$instanceName]['version'] = $extraResults[$instanceName];
43 43
             }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     protected function listInstances($instanceList)
57 57
     {
58 58
         $out = [];
59
-        foreach($instanceList as $instanceName => $connectionSpec) {
59
+        foreach ($instanceList as $instanceName => $connectionSpec) {
60 60
             //$connectionSpec = $this->dbConfigurationManager->getInstanceConfiguration($instanceName);
61 61
             $out[$instanceName] = [
62 62
                 'vendor' => $connectionSpec['vendor'],
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         return $this->executeSqlAction(
72 72
             $instanceList,
73 73
             'Getting database version information',
74
-            function ($schemaManager, $instanceName) {
74
+            function($schemaManager, $instanceName) {
75 75
                 /** @var DatabaseSchemaManager $schemaManager */
76 76
                 return $schemaManager->getRetrieveVersionInfoSqlAction();
77 77
             }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             file_put_contents($this->outputFile, $data);
102 102
             $this->writeln("Results saved to file {$this->outputFile}");
103 103
         } else {
104
-            $this->writeln($data, OutputInterface::VERBOSITY_QUIET,  OutputInterface::OUTPUT_RAW);
104
+            $this->writeln($data, OutputInterface::VERBOSITY_QUIET, OutputInterface::OUTPUT_RAW);
105 105
         }
106 106
 
107 107
     }
Please login to merge, or discard this patch.
app/src/Service/DatabaseConfigurationManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
         }
30 30
 
31 31
         $names = [];
32
-        foreach(array_keys($this->instanceList) as $name) {
32
+        foreach (array_keys($this->instanceList) as $name) {
33 33
 
34 34
             if (empty($includeFilter)) {
35 35
                 $include = true;
36 36
             } else {
37 37
                 $include = false;
38
-                foreach($includeFilter as $filter) {
38
+                foreach ($includeFilter as $filter) {
39 39
                     if (fnmatch($filter, $name)) {
40 40
                         $include = true;
41 41
                         break;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             }
45 45
 
46 46
             if ($include && !empty($excludeFilter)) {
47
-                foreach($excludeFilter as $filter) {
47
+                foreach ($excludeFilter as $filter) {
48 48
                     if (fnmatch($filter, $name)) {
49 49
                         $include = false;
50 50
                         break;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function getInstancesConfiguration(array $instanceNames)
82 82
     {
83 83
         $instancesDefinitions = [];
84
-        foreach($instanceNames as $instanceName)
84
+        foreach ($instanceNames as $instanceName)
85 85
         {
86 86
             $instancesDefinitions[$instanceName] = $this->getInstanceConfiguration($instanceName);
87 87
         }
Please login to merge, or discard this patch.
app/src/Command/SqlShell.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
         }
54 54
         $executor = $this->executorFactory->createForkedExecutor($instanceName, $dbConnectionSpec, NativeClient::EXECUTION_STRATEGY, false);
55 55
 
56
-        if (! $executor instanceof ShellExecutor) {
56
+        if (!$executor instanceof ShellExecutor) {
57 57
             throw new \Exception("Can not start an interactive shell for databases of type '{$dbConnectionSpec['vendor']}'");
58 58
         }
59 59
 
Please login to merge, or discard this patch.
app/src/Core/SqlExecutor/Forked/PDO.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,18 +51,18 @@  discard block
 block discarded – undo
51 51
         $options = [
52 52
             'bin/dbconsole',
53 53
             'sql:execute',
54
-            '--only-instances=' . $this->instanceName,
54
+            '--only-instances='.$this->instanceName,
55 55
             '--execute-in-process',
56
-            '--execution-strategy=' . static::EXECUTION_STRATEGY,
56
+            '--execution-strategy='.static::EXECUTION_STRATEGY,
57 57
             '--output-type=json',
58 58
         ];
59 59
 
60 60
         switch ($action) {
61 61
             case self::EXECUTE_COMMAND:
62
-                $options[] = '--sql=' . $sqlOrFilename;
62
+                $options[] = '--sql='.$sqlOrFilename;
63 63
                 break;
64 64
             case self::EXECUTE_FILE:
65
-                $options[] = '--file=' . $sqlOrFilename;
65
+                $options[] = '--file='.$sqlOrFilename;
66 66
                 break;
67 67
             default:
68 68
                 throw new \OutOfBoundsException('Unsupported action: $action');
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 
73 73
         if ($instanceConfiguration != $this->databaseConfiguration) {
74 74
             if (isset($this->databaseConfiguration['dbname'])) {
75
-                $options[] = '--database=' . $this->databaseConfiguration['dbname'];
75
+                $options[] = '--database='.$this->databaseConfiguration['dbname'];
76 76
             }
77 77
             if (isset($this->databaseConfiguration['user'])) {
78
-                $options[] = '--user=' . $this->databaseConfiguration['user'];
78
+                $options[] = '--user='.$this->databaseConfiguration['user'];
79 79
             }
80 80
             if (isset($this->databaseConfiguration['password'])) {
81
-                $options[] = '--password=' . $this->databaseConfiguration['password'];
81
+                $options[] = '--password='.$this->databaseConfiguration['password'];
82 82
             }
83 83
         }
84 84
 
Please login to merge, or discard this patch.
app/src/Core/DatabaseManager/PostgreSQL.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     {
18 18
         return new Command(
19 19
             'SELECT datname AS "Database" FROM pg_database ORDER BY datname;',
20
-            function ($output, $executor) {
20
+            function($output, $executor) {
21 21
                 /** @var Executor $executor */
22 22
                 return $executor->resultSetToArray($output);
23 23
             }
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
         $statements = [
41 41
             // q: do we need to add 'TEMPLATE template0' ?
42 42
             //    see f.e. https://www.vertabelo.com/blog/collations-in-postgresql/
43
-            "CREATE DATABASE \"$dbName\"" . ($collation !== null ? " ENCODING $collation" : '') . ';',
43
+            "CREATE DATABASE \"$dbName\"".($collation !== null ? " ENCODING $collation" : '').';',
44 44
         ];
45 45
         if ($userName != '') {
46 46
             $statements[] = "COMMIT;";
47
-            $statements[] = "CREATE USER \"$userName\" WITH PASSWORD '$password'" . ';';
47
+            $statements[] = "CREATE USER \"$userName\" WITH PASSWORD '$password'".';';
48 48
             $statements[] = "GRANT ALL ON DATABASE \"$dbName\" TO \"$userName\""; // q: should we avoid granting CREATE?
49 49
         }
50 50
         return new Command($statements);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         return new Command(
84 84
             'SELECT usename AS "User" FROM pg_catalog.pg_user ORDER BY usename;',
85
-            function ($output, $executor) {
85
+            function($output, $executor) {
86 86
                 /** @var Executor $executor */
87 87
                 return $executor->resultSetToArray($output);
88 88
             }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     {
116 116
         return new Command(
117 117
             'SELECT collname AS Collation FROM pg_collation ORDER BY collname',
118
-            function ($output, $executor) {
118
+            function($output, $executor) {
119 119
                 /** @var Executor $executor */
120 120
                 return $executor->resultSetToArray($output);
121 121
             }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         return new Command(
132 132
             'SHOW server_version;',
133
-            function ($output, $executor) {
133
+            function($output, $executor) {
134 134
                 /** @var Executor $executor */
135 135
                 return $executor->resultSetToArray($output)[0];
136 136
             }
Please login to merge, or discard this patch.
app/src/Core/DatabaseManager/SQLServer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         // the way we create it, the user account is contained in the db
20 20
         // @todo add "WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')" ?
21 21
             "SELECT name AS 'Database' FROM sys.databases ORDER BY name;",
22
-            function ($output, $executor) {
22
+            function($output, $executor) {
23 23
                 /** @var Executor $executor */
24 24
                 return $executor->resultSetToArray($output);
25 25
             }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             // Also, by default connections are in autocommit mode...
46 46
             // And yet, we need a GO to commit the db creation...
47 47
             "SET QUOTED_IDENTIFIER ON;",
48
-            "CREATE DATABASE \"$dbName\"" . ($collation !== null ? " COLLATE $collation" : '') . ';'
48
+            "CREATE DATABASE \"$dbName\"".($collation !== null ? " COLLATE $collation" : '').';'
49 49
         ];
50 50
         if ($userName != '') {
51 51
             $statements[] = "CREATE LOGIN \"$userName\" WITH PASSWORD = '$password', DEFAULT_DATABASE = \"$dbName\", CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF;";
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         return new Command(
97 97
             "SELECT name AS 'User' FROM sys.sql_logins ORDER BY name",
98
-            function ($output, $executor) {
98
+            function($output, $executor) {
99 99
                 /** @var Executor $executor */
100 100
                 return $executor->resultSetToArray($output);
101 101
             }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     {
133 133
         return new Command(
134 134
             'SELECT name AS Collation FROM fn_helpcollations();',
135
-            function ($output, $executor) {
135
+            function($output, $executor) {
136 136
                 /** @var Executor $executor */
137 137
                 return $executor->resultSetToArray($output);
138 138
             }
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
     {
148 148
         return new Command(
149 149
             "SELECT @@version",
150
-            function ($output, $executor) {
150
+            function($output, $executor) {
151 151
                 /** @var Executor $executor */
152 152
                 $output = $executor->resultSetToArray($output);
153 153
                 $line = $output[0];
154 154
                 preg_match('/Microsoft SQL Server +([^ ]+) +([^ ]+) +/', $line, $matches);
155
-                return $matches[1] . ' ' . $matches[2];
155
+                return $matches[1].' '.$matches[2];
156 156
             }
157 157
         );
158 158
     }
Please login to merge, or discard this patch.