@@ -62,6 +62,6 @@ |
||
| 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 | } |
@@ -134,10 +134,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -131,10 +131,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -98,10 +98,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -33,7 +33,7 @@ |
||
| 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 | |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -232,7 +232,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public static function invalidPlatformSpecified() : self |
| 48 | 48 | { |
| 49 | 49 | return new self( |
| 50 | - "Invalid 'platform' option specified, need to give an instance of ". |
|
| 50 | + "Invalid 'platform' option specified, need to give an instance of " . |
|
| 51 | 51 | "\Doctrine\DBAL\Platforms\AbstractPlatform."); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public static function invalidPdoInstance() |
| 102 | 102 | { |
| 103 | 103 | return new self( |
| 104 | - "The 'pdo' option was used in DriverManager::getConnection() but no ". |
|
| 104 | + "The 'pdo' option was used in DriverManager::getConnection() but no " . |
|
| 105 | 105 | "instance of PDO was given." |
| 106 | 106 | ); |
| 107 | 107 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - return new self("The options 'driver' or 'driverClass' are mandatory if no PDO ". |
|
| 126 | + return new self("The options 'driver' or 'driverClass' are mandatory if no PDO " . |
|
| 127 | 127 | "instance is given to DriverManager::getConnection()."); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public static function unknownDriver($unknownDriverName, array $knownDrivers) |
| 137 | 137 | { |
| 138 | - return new self("The given 'driver' ".$unknownDriverName." is unknown, ". |
|
| 139 | - "Doctrine currently supports only the following drivers: ".implode(", ", $knownDrivers)); |
|
| 138 | + return new self("The given 'driver' " . $unknownDriverName . " is unknown, " . |
|
| 139 | + "Doctrine currently supports only the following drivers: " . implode(", ", $knownDrivers)); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public static function driverExceptionDuringQuery(Driver $driver, \Exception $driverEx, $sql, array $params = []) |
| 151 | 151 | { |
| 152 | - $msg = "An exception occurred while executing '".$sql."'"; |
|
| 152 | + $msg = "An exception occurred while executing '" . $sql . "'"; |
|
| 153 | 153 | if ($params) { |
| 154 | 154 | $msg .= " with params " . self::formatParameters($params); |
| 155 | 155 | } |
| 156 | - $msg .= ":\n\n".$driverEx->getMessage(); |
|
| 156 | + $msg .= ":\n\n" . $driverEx->getMessage(); |
|
| 157 | 157 | |
| 158 | 158 | return static::wrapException($driver, $driverEx, $msg); |
| 159 | 159 | } |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | private static function formatParameters(array $params) |
| 199 | 199 | { |
| 200 | - return '[' . implode(', ', array_map(function ($param) { |
|
| 200 | + return '[' . implode(', ', array_map(function($param) { |
|
| 201 | 201 | if (is_resource($param)) { |
| 202 | 202 | return (string) $param; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $json = @json_encode($param); |
| 206 | 206 | |
| 207 | - if (! is_string($json) || $json == 'null' && is_string($param)) { |
|
| 207 | + if ( ! is_string($json) || $json == 'null' && is_string($param)) { |
|
| 208 | 208 | // JSON encoding failed, this is not a UTF-8 string. |
| 209 | 209 | return '"\x' . implode('\x', str_split(bin2hex($param), 2)) . '"'; |
| 210 | 210 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | public static function invalidWrapperClass($wrapperClass) |
| 222 | 222 | { |
| 223 | - return new self("The given 'wrapperClass' ".$wrapperClass." has to be a ". |
|
| 223 | + return new self("The given 'wrapperClass' " . $wrapperClass . " has to be a " . |
|
| 224 | 224 | "subtype of \Doctrine\DBAL\Connection."); |
| 225 | 225 | } |
| 226 | 226 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public static function invalidDriverClass($driverClass) |
| 233 | 233 | { |
| 234 | - return new self("The given 'driverClass' ".$driverClass." has to implement the ". |
|
| 234 | + return new self("The given 'driverClass' " . $driverClass . " has to implement the " . |
|
| 235 | 235 | "\Doctrine\DBAL\Driver interface."); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | public static function invalidTableName($tableName) |
| 244 | 244 | { |
| 245 | - return new self("Invalid table name specified: ".$tableName); |
|
| 245 | + return new self("Invalid table name specified: " . $tableName); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public static function noColumnsSpecifiedForTable($tableName) |
| 254 | 254 | { |
| 255 | - return new self("No columns specified for table ".$tableName); |
|
| 255 | + return new self("No columns specified for table " . $tableName); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | public static function typeExists($name) |
| 272 | 272 | { |
| 273 | - return new self('Type '.$name.' already exists.'); |
|
| 273 | + return new self('Type ' . $name . ' already exists.'); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public static function unknownColumnType($name) |
| 282 | 282 | { |
| 283 | - return new self('Unknown column type "'.$name.'" requested. Any Doctrine type that you use has ' . |
|
| 283 | + return new self('Unknown column type "' . $name . '" requested. Any Doctrine type that you use has ' . |
|
| 284 | 284 | 'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the ' . |
| 285 | 285 | 'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database ' . |
| 286 | 286 | 'introspection then you might have forgotten to register all database types for a Doctrine Type. Use ' . |
@@ -297,6 +297,6 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public static function typeNotFound($name) |
| 299 | 299 | { |
| 300 | - return new self('Type to be overwritten '.$name.' does not exist.'); |
|
| 300 | + return new self('Type to be overwritten ' . $name . ' does not exist.'); |
|
| 301 | 301 | } |
| 302 | 302 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | // we identify perf tests by class, method, and dataset |
| 34 | 34 | $class = str_replace('Doctrine\Tests\DBAL\Performance\\', '', get_class($test)); |
| 35 | 35 | |
| 36 | - if (!isset($this->timings[$class])) { |
|
| 36 | + if ( ! isset($this->timings[$class])) { |
|
| 37 | 37 | $this->timings[$class] = []; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function __destruct() |
| 52 | 52 | { |
| 53 | - if (!empty($this->timings)) { |
|
| 53 | + if ( ! empty($this->timings)) { |
|
| 54 | 54 | // Report timings. |
| 55 | 55 | print("\nPerformance test results:\n\n"); |
| 56 | 56 | |
| 57 | - foreach($this->timings as $class => $tests) { |
|
| 57 | + foreach ($this->timings as $class => $tests) { |
|
| 58 | 58 | printf("%s:\n", $class); |
| 59 | - foreach($tests as $test => $time) { |
|
| 59 | + foreach ($tests as $test => $time) { |
|
| 60 | 60 | printf("\t%s: %.3f seconds\n", $test, $time); |
| 61 | 61 | } |
| 62 | 62 | } |