@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | */ |
| 290 | 290 | public function in($x, $y) |
| 291 | 291 | { |
| 292 | - return $this->comparison($x, 'IN', '('.implode(', ', (array) $y).')'); |
|
| 292 | + return $this->comparison($x, 'IN', '(' . implode(', ', (array) $y) . ')'); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | public function notIn($x, $y) |
| 304 | 304 | { |
| 305 | - return $this->comparison($x, 'NOT IN', '('.implode(', ', (array) $y).')'); |
|
| 305 | + return $this->comparison($x, 'NOT IN', '(' . implode(', ', (array) $y) . ')'); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * Constant that represents an OR composite expression. |
| 42 | 42 | */ |
| 43 | - const TYPE_OR = 'OR'; |
|
| 43 | + const TYPE_OR = 'OR'; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * The instance type of composite expression. |
@@ -143,9 +143,9 @@ |
||
| 143 | 143 | |
| 144 | 144 | $keywords = []; |
| 145 | 145 | foreach ($keywordLists as $keywordList) { |
| 146 | - if (!isset($this->keywordListClasses[$keywordList])) { |
|
| 146 | + if ( ! isset($this->keywordListClasses[$keywordList])) { |
|
| 147 | 147 | throw new \InvalidArgumentException( |
| 148 | - "There exists no keyword list with name '" . $keywordList . "'. ". |
|
| 148 | + "There exists no keyword list with name '" . $keywordList . "'. " . |
|
| 149 | 149 | "Known lists: " . implode(", ", array_keys($this->keywordListClasses)) |
| 150 | 150 | ); |
| 151 | 151 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function __construct(array $params, Driver $driver, Configuration $config = null, EventManager $eventManager = null) |
| 114 | 114 | { |
| 115 | - if ( !isset($params['slaves']) || !isset($params['master'])) { |
|
| 115 | + if ( ! isset($params['slaves']) || ! isset($params['master'])) { |
|
| 116 | 116 | throw new \InvalidArgumentException('master or slaves configuration missing'); |
| 117 | 117 | } |
| 118 | 118 | if (count($params['slaves']) == 0) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | // If we have a connection open, and this is not an explicit connection |
| 155 | 155 | // change request, then abort right here, because we are already done. |
| 156 | 156 | // This prevents writes to the slave in case of "keepSlave" option enabled. |
| 157 | - if (isset($this->_conn) && $this->_conn && !$requestedConnectionChange) { |
|
| 157 | + if (isset($this->_conn) && $this->_conn && ! $requestedConnectionChange) { |
|
| 158 | 158 | return false; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function getDropForeignKeySQL($foreignKey, $table) |
| 217 | 217 | { |
| 218 | - if (! $foreignKey instanceof ForeignKeyConstraint) { |
|
| 218 | + if ( ! $foreignKey instanceof ForeignKeyConstraint) { |
|
| 219 | 219 | $foreignKey = new Identifier($foreignKey); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - if (! $table instanceof Table) { |
|
| 222 | + if ( ! $table instanceof Table) { |
|
| 223 | 223 | $table = new Identifier($table); |
| 224 | 224 | } |
| 225 | 225 | |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | { |
| 237 | 237 | if ($index instanceof Index) { |
| 238 | 238 | $index = $index->getQuotedName($this); |
| 239 | - } elseif (!is_string($index)) { |
|
| 239 | + } elseif ( ! is_string($index)) { |
|
| 240 | 240 | throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - if (!isset($table)) { |
|
| 243 | + if ( ! isset($table)) { |
|
| 244 | 244 | return 'DROP INDEX ' . $index; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -282,13 +282,13 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | $columnListSql = $this->getColumnDeclarationListSQL($columns); |
| 284 | 284 | |
| 285 | - if (isset($options['uniqueConstraints']) && !empty($options['uniqueConstraints'])) { |
|
| 285 | + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { |
|
| 286 | 286 | foreach ($options['uniqueConstraints'] as $name => $definition) { |
| 287 | 287 | $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition); |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - if (isset($options['primary']) && !empty($options['primary'])) { |
|
| 291 | + if (isset($options['primary']) && ! empty($options['primary'])) { |
|
| 292 | 292 | $flags = ''; |
| 293 | 293 | if (isset($options['primary_index']) && $options['primary_index']->hasFlag('nonclustered')) { |
| 294 | 294 | $flags = ' NONCLUSTERED'; |
@@ -299,14 +299,14 @@ discard block |
||
| 299 | 299 | $query = 'CREATE TABLE ' . $tableName . ' (' . $columnListSql; |
| 300 | 300 | |
| 301 | 301 | $check = $this->getCheckDeclarationSQL($columns); |
| 302 | - if (!empty($check)) { |
|
| 302 | + if ( ! empty($check)) { |
|
| 303 | 303 | $query .= ', ' . $check; |
| 304 | 304 | } |
| 305 | 305 | $query .= ')'; |
| 306 | 306 | |
| 307 | 307 | $sql[] = $query; |
| 308 | 308 | |
| 309 | - if (isset($options['indexes']) && !empty($options['indexes'])) { |
|
| 309 | + if (isset($options['indexes']) && ! empty($options['indexes'])) { |
|
| 310 | 310 | foreach ($options['indexes'] as $index) { |
| 311 | 311 | $sql[] = $this->getCreateIndexSQL($index, $tableName); |
| 312 | 312 | } |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | { |
| 419 | 419 | $constraint = parent::getCreateIndexSQL($index, $table); |
| 420 | 420 | |
| 421 | - if ($index->isUnique() && !$index->isPrimary()) { |
|
| 421 | + if ($index->isUnique() && ! $index->isPrimary()) { |
|
| 422 | 422 | $constraint = $this->_appendUniqueConstraintDefinition($constraint, $index); |
| 423 | 423 | } |
| 424 | 424 | |
@@ -1127,7 +1127,7 @@ discard block |
||
| 1127 | 1127 | */ |
| 1128 | 1128 | public function getSubstringExpression($value, $from, $length = null) |
| 1129 | 1129 | { |
| 1130 | - if (!is_null($length)) { |
|
| 1130 | + if ( ! is_null($length)) { |
|
| 1131 | 1131 | return 'SUBSTRING(' . $value . ', ' . $from . ', ' . $length . ')'; |
| 1132 | 1132 | } |
| 1133 | 1133 | |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | */ |
| 1220 | 1220 | protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) |
| 1221 | 1221 | { |
| 1222 | - return (!empty($columnDef['autoincrement'])) ? ' IDENTITY' : ''; |
|
| 1222 | + return ( ! empty($columnDef['autoincrement'])) ? ' IDENTITY' : ''; |
|
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | 1225 | /** |
@@ -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; |
| 6 | 6 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function getJsonTypeDeclarationSQL(array $field) |
| 37 | 37 | { |
| 38 | - if (!empty($field['jsonb'])) { |
|
| 38 | + if ( ! empty($field['jsonb'])) { |
|
| 39 | 39 | return 'JSONB'; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function getVarcharTypeDeclarationSQL(array $field) |
| 293 | 293 | { |
| 294 | - if ( !isset($field['length'])) { |
|
| 294 | + if ( ! isset($field['length'])) { |
|
| 295 | 295 | $field['length'] = $this->getVarcharDefaultLength(); |
| 296 | 296 | } |
| 297 | 297 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $this->initializeAllDoctrineTypeMappings(); |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | - if (!Types\Type::hasType($doctrineType)) { |
|
| 429 | + if ( ! Types\Type::hasType($doctrineType)) { |
|
| 430 | 430 | throw DBALException::typeNotFound($doctrineType); |
| 431 | 431 | } |
| 432 | 432 | |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | $dbType = strtolower($dbType); |
| 459 | 459 | |
| 460 | - if (!isset($this->doctrineTypeMapping[$dbType])) { |
|
| 461 | - throw new \Doctrine\DBAL\DBALException("Unknown database type ".$dbType." requested, " . get_class($this) . " may not support it."); |
|
| 460 | + if ( ! isset($this->doctrineTypeMapping[$dbType])) { |
|
| 461 | + throw new \Doctrine\DBAL\DBALException("Unknown database type " . $dbType . " requested, " . get_class($this) . " may not support it."); |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | return $this->doctrineTypeMapping[$dbType]; |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | */ |
| 1004 | 1004 | public function getBetweenExpression($expression, $value1, $value2) |
| 1005 | 1005 | { |
| 1006 | - return $expression . ' BETWEEN ' .$value1 . ' AND ' . $value2; |
|
| 1006 | + return $expression . ' BETWEEN ' . $value1 . ' AND ' . $value2; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | /** |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | |
| 1430 | 1430 | if ($table instanceof Table) { |
| 1431 | 1431 | $table = $table->getQuotedName($this); |
| 1432 | - } elseif (!is_string($table)) { |
|
| 1432 | + } elseif ( ! is_string($table)) { |
|
| 1433 | 1433 | throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); |
| 1434 | 1434 | } |
| 1435 | 1435 | |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | { |
| 1472 | 1472 | if ($index instanceof Index) { |
| 1473 | 1473 | $index = $index->getQuotedName($this); |
| 1474 | - } elseif (!is_string($index)) { |
|
| 1474 | + } elseif ( ! is_string($index)) { |
|
| 1475 | 1475 | throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); |
| 1476 | 1476 | } |
| 1477 | 1477 | |
@@ -1488,11 +1488,11 @@ discard block |
||
| 1488 | 1488 | */ |
| 1489 | 1489 | public function getDropConstraintSQL($constraint, $table) |
| 1490 | 1490 | { |
| 1491 | - if (! $constraint instanceof Constraint) { |
|
| 1491 | + if ( ! $constraint instanceof Constraint) { |
|
| 1492 | 1492 | $constraint = new Identifier($constraint); |
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | - if (! $table instanceof Table) { |
|
| 1495 | + if ( ! $table instanceof Table) { |
|
| 1496 | 1496 | $table = new Identifier($table); |
| 1497 | 1497 | } |
| 1498 | 1498 | |
@@ -1512,11 +1512,11 @@ discard block |
||
| 1512 | 1512 | */ |
| 1513 | 1513 | public function getDropForeignKeySQL($foreignKey, $table) |
| 1514 | 1514 | { |
| 1515 | - if (! $foreignKey instanceof ForeignKeyConstraint) { |
|
| 1515 | + if ( ! $foreignKey instanceof ForeignKeyConstraint) { |
|
| 1516 | 1516 | $foreignKey = new Identifier($foreignKey); |
| 1517 | 1517 | } |
| 1518 | 1518 | |
| 1519 | - if (! $table instanceof Table) { |
|
| 1519 | + if ( ! $table instanceof Table) { |
|
| 1520 | 1520 | $table = new Identifier($table); |
| 1521 | 1521 | } |
| 1522 | 1522 | |
@@ -1554,7 +1554,7 @@ discard block |
||
| 1554 | 1554 | $options['indexes'] = []; |
| 1555 | 1555 | $options['primary'] = []; |
| 1556 | 1556 | |
| 1557 | - if (($createFlags&self::CREATE_INDEXES) > 0) { |
|
| 1557 | + if (($createFlags & self::CREATE_INDEXES) > 0) { |
|
| 1558 | 1558 | foreach ($table->getIndexes() as $index) { |
| 1559 | 1559 | /* @var $index Index */ |
| 1560 | 1560 | if ($index->isPrimary()) { |
@@ -1599,7 +1599,7 @@ discard block |
||
| 1599 | 1599 | $columns[$columnData['name']] = $columnData; |
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | - if (($createFlags&self::CREATE_FOREIGNKEYS) > 0) { |
|
| 1602 | + if (($createFlags & self::CREATE_FOREIGNKEYS) > 0) { |
|
| 1603 | 1603 | $options['foreignKeys'] = []; |
| 1604 | 1604 | foreach ($table->getForeignKeys() as $fkConstraint) { |
| 1605 | 1605 | $options['foreignKeys'][] = $fkConstraint; |
@@ -1657,7 +1657,7 @@ discard block |
||
| 1657 | 1657 | */ |
| 1658 | 1658 | public function getInlineColumnCommentSQL($comment) |
| 1659 | 1659 | { |
| 1660 | - if (! $this->supportsInlineColumnComments()) { |
|
| 1660 | + if ( ! $this->supportsInlineColumnComments()) { |
|
| 1661 | 1661 | throw DBALException::notSupported(__METHOD__); |
| 1662 | 1662 | } |
| 1663 | 1663 | |
@@ -1766,7 +1766,7 @@ discard block |
||
| 1766 | 1766 | |
| 1767 | 1767 | $query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this); |
| 1768 | 1768 | |
| 1769 | - $columnList = '('. implode(', ', $constraint->getQuotedColumns($this)) . ')'; |
|
| 1769 | + $columnList = '(' . implode(', ', $constraint->getQuotedColumns($this)) . ')'; |
|
| 1770 | 1770 | |
| 1771 | 1771 | $referencesClause = ''; |
| 1772 | 1772 | if ($constraint instanceof Index) { |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | $referencesClause = ' REFERENCES ' . $constraint->getQuotedForeignTableName($this) . |
| 1786 | 1786 | ' (' . implode(', ', $constraint->getQuotedForeignColumns($this)) . ')'; |
| 1787 | 1787 | } |
| 1788 | - $query .= ' '.$columnList.$referencesClause; |
|
| 1788 | + $query .= ' ' . $columnList . $referencesClause; |
|
| 1789 | 1789 | |
| 1790 | 1790 | return $query; |
| 1791 | 1791 | } |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | { |
| 1912 | 1912 | $c = $this->getIdentifierQuoteCharacter(); |
| 1913 | 1913 | |
| 1914 | - return $c . str_replace($c, $c.$c, $str) . $c; |
|
| 1914 | + return $c . str_replace($c, $c . $c, $str) . $c; |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | /** |
@@ -2687,7 +2687,7 @@ discard block |
||
| 2687 | 2687 | */ |
| 2688 | 2688 | public function convertFromBoolean($item) |
| 2689 | 2689 | { |
| 2690 | - return null === $item ? null: (bool) $item ; |
|
| 2690 | + return null === $item ? null: (bool) $item; |
|
| 2691 | 2691 | } |
| 2692 | 2692 | |
| 2693 | 2693 | /** |
@@ -413,7 +413,7 @@ |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | return 'ALTER TABLE ' . $table . |
| 416 | - ' ADD ' . $this->getTableConstraintDeclarationSQL($constraint, $constraint->getQuotedName($this)); |
|
| 416 | + ' ADD ' . $this->getTableConstraintDeclarationSQL($constraint, $constraint->getQuotedName($this)); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | /** |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | $oldColumnName = new Identifier($oldColumnName); |
| 279 | 279 | |
| 280 | - return 'RENAME ' . $oldColumnName->getQuotedName($this) .' TO ' . $column->getQuotedName($this); |
|
| 280 | + return 'RENAME ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /** |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | */ |
| 434 | 434 | public function getCreateIndexSQL(Index $index, $table) |
| 435 | 435 | { |
| 436 | - return parent::getCreateIndexSQL($index, $table). $this->getAdvancedIndexOptionsSQL($index); |
|
| 436 | + return parent::getCreateIndexSQL($index, $table) . $this->getAdvancedIndexOptionsSQL($index); |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | /** |
@@ -1403,10 +1403,10 @@ discard block |
||
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 | if ($constraint->isPrimary()) { |
| 1406 | - return $sql . 'PRIMARY KEY ' . $flags . '('. $this->getIndexFieldDeclarationListSQL($constraintColumns) . ')'; |
|
| 1406 | + return $sql . 'PRIMARY KEY ' . $flags . '(' . $this->getIndexFieldDeclarationListSQL($constraintColumns) . ')'; |
|
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | - return $sql . 'UNIQUE ' . $flags . '('. $this->getIndexFieldDeclarationListSQL($constraintColumns) . ')'; |
|
| 1409 | + return $sql . 'UNIQUE ' . $flags . '(' . $this->getIndexFieldDeclarationListSQL($constraintColumns) . ')'; |
|
| 1410 | 1410 | } |
| 1411 | 1411 | |
| 1412 | 1412 | /** |