@@ -29,8 +29,9 @@ |
||
| 29 | 29 | public function getAllRecords() |
| 30 | 30 | { |
| 31 | 31 | $allRecords = $this->allRecords; |
| 32 | - foreach ($allRecords() as $recordData) |
|
| 33 | - yield $recordData; |
|
| 32 | + foreach ($allRecords() as $recordData) { |
|
| 33 | + yield $recordData; |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | /** @return Record */ |
@@ -12,8 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($totalDigits, $fractionalDigits) |
| 14 | 14 | { |
| 15 | - if ($totalDigits <= $fractionalDigits) |
|
| 16 | - throw new \InvalidArgumentException("'totalDigits' ({$totalDigits}) has to be larger than 'fractionalDigits' ({$fractionalDigits})"); |
|
| 15 | + if ($totalDigits <= $fractionalDigits) { |
|
| 16 | + throw new \InvalidArgumentException("'totalDigits' ({$totalDigits}) has to be larger than 'fractionalDigits' ({$fractionalDigits})"); |
|
| 17 | + } |
|
| 17 | 18 | |
| 18 | 19 | $this->totalDigits = $totalDigits; |
| 19 | 20 | $this->fractionalDigits = $fractionalDigits; |
@@ -40,7 +40,9 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->updateTable($table); |
| 42 | 42 | |
| 43 | - if (!$metadata->generateSnapshot()) return; |
|
| 43 | + if (!$metadata->generateSnapshot()) { |
|
| 44 | + return; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | $table = $this->generateTable($metadata, true); |
| 46 | 48 | $table->setPrimaryKey([$this->idColumnName, $metadata->getSnapshotColumnName()]); |
@@ -72,13 +74,15 @@ discard block |
||
| 72 | 74 | function(Table $existingTable) use ($table) { return $table->getName() == $existingTable->getName(); } |
| 73 | 75 | ); |
| 74 | 76 | |
| 75 | - if (count($existingTables) > 1) |
|
| 76 | - throw new \UnexpectedValueException(sprintf("Multiple tables with the name '%s' exist.", $table->getName())); |
|
| 77 | + if (count($existingTables) > 1) { |
|
| 78 | + throw new \UnexpectedValueException(sprintf("Multiple tables with the name '%s' exist.", $table->getName())); |
|
| 79 | + } |
|
| 77 | 80 | |
| 78 | 81 | if (count($existingTables) == 1) { |
| 79 | 82 | $tableDiff = $this->schemaComparator->diffTable(current($existingTables), $table); |
| 80 | - if ($tableDiff) |
|
| 81 | - $this->schemaManager->alterTable($tableDiff); |
|
| 83 | + if ($tableDiff) { |
|
| 84 | + $this->schemaManager->alterTable($tableDiff); |
|
| 85 | + } |
|
| 82 | 86 | } else { |
| 83 | 87 | $this->schemaManager->createTable($table); |
| 84 | 88 | } |