Passed
Push — main ( 4d8086...f81a94 )
by Thierry
07:24 queued 01:04
created
src/Driver.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @var array
23 23
      */
24
-    private $types = [ //! arrays
24
+    private $types = [//! arrays
25 25
         'Numbers' => ["smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1,
26 26
             "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20],
27 27
         'Date and time' => ["date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0],
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     private $editFunctions = [[
71 71
         "char" => "md5",
72 72
         "date|time" => "now",
73
-    ],[
73
+    ], [
74 74
         // $this->numberRegex() => "+/-",
75 75
         "date|time" => "+ interval/- interval", //! escape
76 76
         "char|text" => "||",
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,11 +91,9 @@
 block discarded – undo
91 91
     {
92 92
         if (extension_loaded("pgsql")) {
93 93
             $connection = new Db\PgSql\Connection($this, $this->util, $this->trans, 'PgSQL');
94
-        }
95
-        elseif (extension_loaded("pdo_pgsql")) {
94
+        } elseif (extension_loaded("pdo_pgsql")) {
96 95
             $connection = new Db\Pdo\Connection($this, $this->util, $this->trans, 'PDO_PgSQL');
97
-        }
98
-        else {
96
+        } else {
99 97
             throw new AuthException($this->trans->lang('No package installed to connect to a PostgreSQL server.'));
100 98
         }
101 99
 
Please login to merge, or discard this patch.
src/Db/Pdo/Connection.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
     public $timeout;
18 18
 
19 19
     /**
20
-    * @inheritDoc
21
-    */
20
+     * @inheritDoc
21
+     */
22 22
     public function open(string $database, string $schema = '')
23 23
     {
24 24
         $server = str_replace(":", "' port='", addcslashes($this->driver->options('server'), "'\\"));
Please login to merge, or discard this patch.
src/Db/Grammar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,13 +114,13 @@
 block discarded – undo
114 114
             switch ($index->type) {
115 115
                 case 'UNIQUE':
116 116
                     $clauses[] = "CONSTRAINT " . $this->escapeId($index_name) .
117
-                        " UNIQUE (" . implode(', ', array_map(function ($column) {
117
+                        " UNIQUE (" . implode(', ', array_map(function($column) {
118 118
                             return $this->escapeId($column);
119 119
                         }, $index->columns)) . ")";
120 120
                     break;
121 121
                 case 'PRIMARY':
122 122
                     $clauses[] = "CONSTRAINT " . $this->escapeId($index_name) .
123
-                        " PRIMARY KEY (" . implode(', ', array_map(function ($column) {
123
+                        " PRIMARY KEY (" . implode(', ', array_map(function($column) {
124 124
                             return $this->escapeId($column);
125 125
                         }, $index->columns)) . ")";
126 126
                     break;
Please login to merge, or discard this patch.
src/Db/Query.php 1 patch
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     protected function limitToOne(string $table, string $query, string $where)
20 20
     {
21
-        return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) :
22
-            " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where :
23
-            " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)'));
21
+        return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) : " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)'));
24 22
     }
25 23
 
26 24
     /**
Please login to merge, or discard this patch.
src/Db/Database.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@  discard block
 block discarded – undo
82 82
             if ($val[0] != 'INDEX') {
83 83
                 //! descending UNIQUE indexes results in syntax error
84 84
                 $create[] = (
85
-                    $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) :
86
-                    "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') .
85
+                    $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) : "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') .
87 86
                     " $val[0] " . ($val[0] == 'PRIMARY' ? 'KEY ' : '') . '(' . implode(', ', $val[2]) . ')'
88 87
                 );
89 88
             } elseif ($val[2] == 'DROP') {
@@ -196,7 +195,7 @@  discard block
 block discarded – undo
196 195
      */
197 196
     public function truncateTables(array $tables)
198 197
     {
199
-        $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function ($table) {
198
+        $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function($table) {
200 199
             return $this->driver->table($table);
201 200
         }, $tables)));
202 201
         return true;
Please login to merge, or discard this patch.