Passed
Branch tests-better-coverage (52d7f0)
by Michael
04:07
created
lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,6 +62,6 @@
 block discarded – undo
62 62
         $sql = parent::getListTableColumnsSQL($table, $database);
63 63
         $parts = explode('AS complete_type,', $sql, 2);
64 64
 
65
-        return $parts[0].'AS complete_type, (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation,'.$parts[1];
65
+        return $parts[0] . 'AS complete_type, (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation,' . $parts[1];
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/PostgreSQL100Platform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\DBAL\Platforms;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
         if ($startPos !== false) {
135 135
             $str = $this->getSubstringExpression($str, $startPos);
136 136
 
137
-            return 'CASE WHEN (POSITION('.$substr.' IN '.$str.') = 0) THEN 0 ELSE (POSITION('.$substr.' IN '.$str.') + '.($startPos-1).') END';
137
+            return 'CASE WHEN (POSITION(' . $substr . ' IN ' . $str . ') = 0) THEN 0 ELSE (POSITION(' . $substr . ' IN ' . $str . ') + ' . ($startPos - 1) . ') END';
138 138
         }
139 139
 
140
-        return 'POSITION('.$substr.' IN '.$str.')';
140
+        return 'POSITION(' . $substr . ' IN ' . $str . ')';
141 141
     }
142 142
 
143 143
     /**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $unit      = DateIntervalUnit::MONTH;
151 151
         }
152 152
 
153
-        return "(" . $date ." " . $operator . " (" . $interval . " || ' " . $unit . "')::interval)";
153
+        return "(" . $date . " " . $operator . " (" . $interval . " || ' " . $unit . "')::interval)";
154 154
     }
155 155
 
156 156
     /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                   (
311 311
                       SELECT c.oid
312 312
                       FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n
313
-                      WHERE " .$this->getTableWhereClause($table) ." AND n.oid = c.relnamespace
313
+                      WHERE " .$this->getTableWhereClause($table) . " AND n.oid = c.relnamespace
314 314
                   )
315 315
                   AND r.contype = 'f'";
316 316
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      */
329 329
     public function getDropViewSQL($name)
330 330
     {
331
-        return 'DROP VIEW '. $name;
331
+        return 'DROP VIEW ' . $name;
332 332
     }
333 333
 
334 334
     /**
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                  WHERE oid IN (
368 368
                     SELECT indexrelid
369 369
                     FROM pg_index si, pg_class sc, pg_namespace sn
370
-                    WHERE " . $this->getTableWhereClause($table, 'sc', 'sn')." AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid
370
+                    WHERE " . $this->getTableWhereClause($table, 'sc', 'sn') . " AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid
371 371
                  ) AND pg_index.indexrelid = oid";
372 372
     }
373 373
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
      */
381 381
     private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n')
382 382
     {
383
-        $whereClause = $namespaceAlias.".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
383
+        $whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
384 384
         if (strpos($table, ".") !== false) {
385 385
             list($schema, $table) = explode(".", $table);
386 386
             $schema = $this->quoteStringLiteral($schema);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                         FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid
425 425
                     ) AS comment
426 426
                     FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n
427
-                    WHERE ".$this->getTableWhereClause($table, 'c', 'n') ."
427
+                    WHERE ".$this->getTableWhereClause($table, 'c', 'n') . "
428 428
                         AND a.attnum > 0
429 429
                         AND a.attrelid = c.oid
430 430
                         AND a.atttypid = t.oid
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
             return $callback($value ? true : false);
823 823
         }
824 824
 
825
-        if (!is_string($value)) {
825
+        if ( ! is_string($value)) {
826 826
             return $callback(true);
827 827
         }
828 828
 
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 
879 879
         return $this->doConvertBooleans(
880 880
             $item,
881
-            function ($boolean) {
881
+            function($boolean) {
882 882
                 if (null === $boolean) {
883 883
                     return 'NULL';
884 884
                 }
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 
900 900
         return $this->doConvertBooleans(
901 901
             $item,
902
-            function ($boolean) {
902
+            function($boolean) {
903 903
                 return null === $boolean ? null : (int) $boolean;
904 904
             }
905 905
         );
@@ -1236,7 +1236,7 @@  discard block
 block discarded – undo
1236 1236
      */
1237 1237
     private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff) : bool
1238 1238
     {
1239
-        if (! $columnDiff->fromColumn) {
1239
+        if ( ! $columnDiff->fromColumn) {
1240 1240
             return $columnDiff->hasChanged('type');
1241 1241
         }
1242 1242
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/DateIntervalUnit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\DBAL\Platforms;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
     public function getLocateExpression($str, $substr, $startPos = false)
132 132
     {
133 133
         if ($startPos == false) {
134
-            return 'LOCATE('.$str.', '.$substr.')';
134
+            return 'LOCATE(' . $str . ', ' . $substr . ')';
135 135
         }
136 136
 
137
-        return 'LOCATE('.$str.', '.$substr.', '.$startPos.')';
137
+        return 'LOCATE(' . $str . ', ' . $substr . ', ' . $startPos . ')';
138 138
     }
139 139
 
140 140
     /**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                         break;
162 162
                 }
163 163
 
164
-                if (! is_numeric($interval)) {
164
+                if ( ! is_numeric($interval)) {
165 165
                     $interval = "' || " . $interval . " || '";
166 166
                 }
167 167
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function getDateDiffExpression($date1, $date2)
176 176
     {
177
-        return 'ROUND(JULIANDAY('.$date1 . ')-JULIANDAY('.$date2.'))';
177
+        return 'ROUND(JULIANDAY(' . $date1 . ')-JULIANDAY(' . $date2 . '))';
178 178
     }
179 179
 
180 180
     /**
@@ -345,12 +345,12 @@  discard block
 block discarded – undo
345 345
 
346 346
         if (isset($options['primary']) && ! empty($options['primary'])) {
347 347
             $keyColumns = array_unique(array_values($options['primary']));
348
-            $queryFields.= ', PRIMARY KEY('.implode(', ', $keyColumns).')';
348
+            $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')';
349 349
         }
350 350
 
351 351
         if (isset($options['foreignKeys'])) {
352 352
             foreach ($options['foreignKeys'] as $foreignKey) {
353
-                $queryFields.= ', '.$this->getForeignKeyDeclarationSQL($foreignKey);
353
+                $queryFields .= ', ' . $this->getForeignKeyDeclarationSQL($foreignKey);
354 354
             }
355 355
         }
356 356
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
      */
481 481
     public function getDropViewSQL($name)
482 482
     {
483
-        return 'DROP VIEW '. $name;
483
+        return 'DROP VIEW ' . $name;
484 484
     }
485 485
 
486 486
     /**
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
         }
683 683
 
684 684
         $sql = [];
685
-        $tableName = $diff->newName ? $diff->getNewName(): $diff->getName($this);
685
+        $tableName = $diff->newName ? $diff->getNewName() : $diff->getName($this);
686 686
         foreach ($this->getIndexesInAlteredTable($diff) as $index) {
687 687
             if ($index->isPrimary()) {
688 688
                 continue;
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
         $sql = [];
887 887
         $tableSql = [];
888 888
         if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
889
-            $dataTable = new Table('__temp__'.$table->getName());
889
+            $dataTable = new Table('__temp__' . $table->getName());
890 890
 
891 891
             $newTable = new Table($table->getQuotedName($this), $columns, $this->getPrimaryIndexInAlteredTable($diff), $this->getForeignKeysInAlteredTable($diff), 0, $table->getOptions());
892 892
             $newTable->addOption('alter', true);
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 
903 903
             if ($diff->newName && $diff->newName != $diff->name) {
904 904
                 $renamedTable = $diff->getNewName();
905
-                $sql[] = 'ALTER TABLE '.$newTable->getQuotedName($this).' RENAME TO '.$renamedTable->getQuotedName($this);
905
+                $sql[] = 'ALTER TABLE ' . $newTable->getQuotedName($this) . ' RENAME TO ' . $renamedTable->getQuotedName($this);
906 906
             }
907 907
 
908 908
             $sql = array_merge($sql, $this->getPostAlterTableIndexForeignKeySQL($diff));
@@ -975,13 +975,13 @@  discard block
 block discarded – undo
975 975
                 $field['length'] = 255;
976 976
             }
977 977
 
978
-            $sql[] = 'ALTER TABLE '.$table->getQuotedName($this).' ADD COLUMN '.$this->getColumnDeclarationSQL($field['name'], $field);
978
+            $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' ADD COLUMN ' . $this->getColumnDeclarationSQL($field['name'], $field);
979 979
         }
980 980
 
981 981
         if ( ! $this->onSchemaAlterTable($diff, $tableSql)) {
982 982
             if ($diff->newName !== false) {
983 983
                 $newTable = new Identifier($diff->newName);
984
-                $sql[] = 'ALTER TABLE '.$table->getQuotedName($this).' RENAME TO '.$newTable->getQuotedName($this);
984
+                $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' RENAME TO ' . $newTable->getQuotedName($this);
985 985
             }
986 986
         }
987 987
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
     public function getLocateExpression($str, $substr, $startPos = false)
99 99
     {
100 100
         if ($startPos == false) {
101
-            return 'INSTR('.$str.', '.$substr.')';
101
+            return 'INSTR(' . $str . ', ' . $substr . ')';
102 102
         }
103 103
 
104
-        return 'INSTR('.$str.', '.$substr.', '.$startPos.')';
104
+        return 'INSTR(' . $str . ', ' . $substr . ', ' . $startPos . ')';
105 105
     }
106 106
 
107 107
     /**
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function getDateDiffExpression($date1, $date2)
169 169
     {
170
-        return "TRUNC(TO_NUMBER(SUBSTR((" . $date1 . "-" . $date2 . "), 1, INSTR(" . $date1 . "-" . $date2 .", ' '))))";
170
+        return "TRUNC(TO_NUMBER(SUBSTR((" . $date1 . "-" . $date2 . "), 1, INSTR(" . $date1 . "-" . $date2 . ", ' '))))";
171 171
     }
172 172
 
173 173
     /**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function getBitAndComparisonExpression($value1, $value2)
177 177
     {
178
-        return 'BITAND('.$value1 . ', ' . $value2 . ')';
178
+        return 'BITAND(' . $value1 . ', ' . $value2 . ')';
179 179
     }
180 180
 
181 181
     /**
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         $database = $this->normalizeIdentifier($database);
390 390
         $database = $this->quoteStringLiteral($database->getName());
391 391
 
392
-        return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ".
392
+        return "SELECT sequence_name, min_value, increment_by FROM sys.all_sequences " .
393 393
                "WHERE SEQUENCE_OWNER = " . $database;
394 394
     }
395 395
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
      */
492 492
     public function getDropViewSQL($name)
493 493
     {
494
-        return 'DROP VIEW '. $name;
494
+        return 'DROP VIEW ' . $name;
495 495
     }
496 496
 
497 497
     /**
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 BEGIN
523 523
   SELECT COUNT(CONSTRAINT_NAME) INTO constraints_Count FROM USER_CONSTRAINTS WHERE TABLE_NAME = \'' . $unquotedTableName . '\' AND CONSTRAINT_TYPE = \'P\';
524 524
   IF constraints_Count = 0 OR constraints_Count = \'\' THEN
525
-    EXECUTE IMMEDIATE \''.$this->getCreateConstraintSQL($idx, $quotedTableName).'\';
525
+    EXECUTE IMMEDIATE \''.$this->getCreateConstraintSQL($idx, $quotedTableName) . '\';
526 526
   END IF;
527 527
 END;';
528 528
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
    last_InsertID NUMBER;
543 543
 BEGIN
544 544
    SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $quotedName . ' FROM DUAL;
545
-   IF (:NEW.' . $quotedName . ' IS NULL OR :NEW.'.$quotedName.' = 0) THEN
545
+   IF (:NEW.' . $quotedName . ' IS NULL OR :NEW.' . $quotedName . ' = 0) THEN
546 546
       SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $quotedName . ' FROM DUAL;
547 547
    ELSE
548 548
       SELECT NVL(Last_Number, 0) INTO last_Sequence
@@ -711,11 +711,11 @@  discard block
 block discarded – undo
711 711
      */
712 712
     public function getDropForeignKeySQL($foreignKey, $table)
713 713
     {
714
-        if (! $foreignKey instanceof ForeignKeyConstraint) {
714
+        if ( ! $foreignKey instanceof ForeignKeyConstraint) {
715 715
             $foreignKey = new Identifier($foreignKey);
716 716
         }
717 717
 
718
-        if (! $table instanceof Table) {
718
+        if ( ! $table instanceof Table) {
719 719
             $table = new Identifier($table);
720 720
         }
721 721
 
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
             $oldColumnName = new Identifier($oldColumnName);
857 857
 
858 858
             $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) .
859
-                ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) .' TO ' . $column->getQuotedName($this);
859
+                ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this);
860 860
         }
861 861
 
862 862
         $fields = [];
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
         }
870 870
 
871 871
         if (count($fields)) {
872
-            $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' DROP (' . implode(', ', $fields).')';
872
+            $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' DROP (' . implode(', ', $fields) . ')';
873 873
         }
874 874
 
875 875
         $tableSql = [];
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
         }
995 995
 
996 996
         if (preg_match('/^\s*SELECT/i', $query)) {
997
-            if (!preg_match('/\sFROM\s/i', $query)) {
997
+            if ( ! preg_match('/\sFROM\s/i', $query)) {
998 998
                 $query .= " FROM dual";
999 999
             }
1000 1000
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     /**
34 34
      * {@inheritDoc}
35 35
      */
36
-    public function getCreateTableSQL(Table $table, $createFlags=self::CREATE_INDEXES)
36
+    public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES)
37 37
     {
38 38
         $sql = parent::getCreateTableSQL($table, $createFlags);
39 39
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL100Keywords.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\DBAL\Platforms\Keywords;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         $query = 'CREATE ';
234 234
 
235
-        if (!empty($options['temporary'])) {
235
+        if ( ! empty($options['temporary'])) {
236 236
             $query .= 'TEMPORARY ';
237 237
         }
238 238
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     /**
431 431
      * {@inheritDoc}
432 432
      */
433
-    public function getDropIndexSQL($index, $table=null)
433
+    public function getDropIndexSQL($index, $table = null)
434 434
     {
435 435
         if ($index instanceof Index) {
436 436
             $indexName = $index->getQuotedName($this);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 
443 443
         if ($table instanceof Table) {
444 444
             $table = $table->getQuotedName($this);
445
-        } elseif (!is_string($table)) {
445
+        } elseif ( ! is_string($table)) {
446 446
             throw new \InvalidArgumentException('DrizzlePlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
447 447
         }
448 448
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
         $queryParts = [];
501 501
 
502 502
         if ($diff->newName !== false) {
503
-            $queryParts[] =  'RENAME TO ' . $diff->getNewName()->getQuotedName($this);
503
+            $queryParts[] = 'RENAME TO ' . $diff->getNewName()->getQuotedName($this);
504 504
         }
505 505
 
506 506
         foreach ($diff->addedColumns as $column) {
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                 continue;
519 519
             }
520 520
 
521
-            $queryParts[] =  'DROP ' . $column->getQuotedName($this);
521
+            $queryParts[] = 'DROP ' . $column->getQuotedName($this);
522 522
         }
523 523
 
524 524
         foreach ($diff->changedColumns as $columnDiff) {
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
             }
542 542
 
543 543
             $columnArray['comment'] = $this->getColumnComment($column);
544
-            $queryParts[] =  'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' '
544
+            $queryParts[] = 'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' '
545 545
                     . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
546 546
         }
547 547
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
             $columnArray = $column->toArray();
556 556
             $columnArray['comment'] = $this->getColumnComment($column);
557
-            $queryParts[] =  'CHANGE ' . $oldColumnName->getQuotedName($this) . ' '
557
+            $queryParts[] = 'CHANGE ' . $oldColumnName->getQuotedName($this) . ' '
558 558
                     . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
559 559
         }
560 560
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
     {
583 583
         if ($table instanceof Table) {
584 584
             $table = $table->getQuotedName($this);
585
-        } elseif (!is_string($table)) {
585
+        } elseif ( ! is_string($table)) {
586 586
             throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
587 587
         }
588 588
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
             return 'LOCATE(' . $substr . ', ' . $str . ')';
617 617
         }
618 618
 
619
-        return 'LOCATE(' . $substr . ', ' . $str . ', '.$startPos.')';
619
+        return 'LOCATE(' . $substr . ', ' . $str . ', ' . $startPos . ')';
620 620
     }
621 621
 
622 622
     /**
Please login to merge, or discard this patch.