From b3d096cdc0f4b42145a5008ace49dacfbf922581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Fri, 7 Sep 2018 10:06:21 +0200 Subject: [PATCH] Coding Style --- lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | 12 ++++++------ lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | 8 ++++---- lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index ee32d3c6256..b58176dcaa8 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -1459,7 +1459,7 @@ public function getDropTableSQL($table) $table = $table->getQuotedName($this); } - if (!is_string($table)) { + if (! is_string($table)) { throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); } @@ -2467,25 +2467,25 @@ public function getCustomTypeDeclarationSQL(array $columnDef) * Obtains DBMS specific SQL code portion needed to set an index * declaration to be used in statements like CREATE TABLE. * - * @param array|Index $columnsOrIndex + * @param mixed[]|Index $columnsOrIndex * * @return string */ - public function getIndexFieldDeclarationListSQL($columnsOrIndex) + public function getIndexFieldDeclarationListSQL($columnsOrIndex) : string { if ($columnsOrIndex instanceof Index) { return implode(', ', $columnsOrIndex->getQuotedColumns($this)); } - if (!is_array($columnsOrIndex)) { + if (! is_array($columnsOrIndex)) { throw new \InvalidArgumentException('Fields argument should be an Index or an array.'); } $ret = []; - foreach ($columnsOrIndex as $field => $definition) { + foreach ($columnsOrIndex as $column => $definition) { if (is_array($definition)) { - $ret[] = $field; + $ret[] = $column; } else { $ret[] = $definition; } diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 936e7c23d48..65289c5bcea 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -1159,9 +1159,9 @@ public function supportsColumnLengthIndexes() /** * {@inheritdoc} */ - public function getIndexFieldDeclarationListSQL($columnsOrIndex) + public function getIndexFieldDeclarationListSQL($columnsOrIndex) : string { - if (!($columnsOrIndex instanceof Index)) { + if (! ($columnsOrIndex instanceof Index)) { return parent::getIndexFieldDeclarationListSQL($columnsOrIndex); } @@ -1170,9 +1170,9 @@ public function getIndexFieldDeclarationListSQL($columnsOrIndex) $ret = []; foreach ($columnsOrIndex->getQuotedColumns($this) as $quotedColumn) { - $length = array_shift($subParts); + $length = \array_shift($subParts); - if (null !== $length) { + if ($length !== null) { $quotedColumn .= '(' . $length . ')'; } diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index 2fc4fbeb139..f975a86f753 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -886,7 +886,7 @@ protected function _getPortableTableIndexesList($tableIndexRows, $tableName=null ]; } - $result[$keyName]['columns'][] = $tableIndex['column_name']; + $result[$keyName]['columns'][] = $tableIndex['column_name']; $result[$keyName]['options']['lengths'][] = $tableIndex['sub_part'] ?? null; }