Unverified Commit de1f02b6 authored by Guilherme Blanco's avatar Guilherme Blanco Committed by GitHub

Apply suggestions from code review

Co-authored-by: 's avatarClaudio Zizza <859964+SenseException@users.noreply.github.com>
parent 204c4c70
...@@ -76,7 +76,7 @@ class Index extends AbstractAsset implements Constraint ...@@ -76,7 +76,7 @@ class Index extends AbstractAsset implements Constraint
* *
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
protected function _addColumn(string $column) protected function _addColumn(string $column) : void
{ {
$this->_columns[$column] = new Identifier($column); $this->_columns[$column] = new Identifier($column);
} }
......
...@@ -529,7 +529,7 @@ class Table extends AbstractAsset ...@@ -529,7 +529,7 @@ class Table extends AbstractAsset
{ {
$constraintName = $this->normalizeIdentifier($constraintName); $constraintName = $this->normalizeIdentifier($constraintName);
if (! $this->hasForeignKey($constraintName)) { if (! $this->hasUniqueConstraint($constraintName)) {
throw SchemaException::uniqueConstraintDoesNotExist($constraintName, $this->_name); throw SchemaException::uniqueConstraintDoesNotExist($constraintName, $this->_name);
} }
...@@ -1010,7 +1010,7 @@ class Table extends AbstractAsset ...@@ -1010,7 +1010,7 @@ class Table extends AbstractAsset
* *
* @return string The normalized identifier. * @return string The normalized identifier.
*/ */
private function normalizeIdentifier(?string $identifier) private function normalizeIdentifier(?string $identifier) : string
{ {
if ($identifier === null) { if ($identifier === null) {
return ''; return '';
...@@ -1026,7 +1026,7 @@ class Table extends AbstractAsset ...@@ -1026,7 +1026,7 @@ class Table extends AbstractAsset
* *
* @return Column[] * @return Column[]
*/ */
private function filterColumns(array $columnNames, bool $reverse = false) private function filterColumns(array $columnNames, bool $reverse = false) : array
{ {
return array_filter($this->_columns, static function ($columnName) use ($columnNames, $reverse) : bool { return array_filter($this->_columns, static function ($columnName) use ($columnNames, $reverse) : bool {
return in_array($columnName, $columnNames, true) !== $reverse; return in_array($columnName, $columnNames, true) !== $reverse;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment