Skip to content

Commit

Permalink
phpcs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Jul 4, 2015
1 parent 5483e7d commit 4282036
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Database/Schema/Table.php
Expand Up @@ -406,15 +406,17 @@ public function addIndex($name, $attrs)
throw new Exception(sprintf('Invalid index type "%s" in index "%s" in table "%s".', $attrs['type'], $name, $this->_table));
}
if (empty($attrs['columns'])) {
throw new Exception(sprintf('Index "%s" in table "%s" must have at least one column.', $name, $this->_table));
throw new Exception(sprintf('Index "%s" in table "%s" must have at least one column.', $name, $this->_table));
}
$attrs['columns'] = (array)$attrs['columns'];
foreach ($attrs['columns'] as $field) {
if (empty($this->_columns[$field])) {
$msg = sprintf(
'Columns used in index "%s" in table "%s" must be added to the Table schema first. ' .
'The column "%s" was not found.',
$name, $this->_table, $field
$name,
$this->_table,
$field
);
throw new Exception($msg);
}
Expand Down Expand Up @@ -503,7 +505,8 @@ public function addConstraint($name, $attrs)
$msg = sprintf(
'Columns used in constraints must be added to the Table schema first. ' .
'The column "%s" was not found in table "%s".',
$field, $this->_table
$field,
$this->_table
);
throw new Exception($msg);
}
Expand Down

0 comments on commit 4282036

Please sign in to comment.