Skip to content

Commit

Permalink
Coding Style
Browse files Browse the repository at this point in the history
  • Loading branch information
bburnichon committed Sep 7, 2018
1 parent ae102ea commit b3d096c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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 . ')';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b3d096c

Please sign in to comment.