Skip to content

Commit

Permalink
Reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 22, 2023
1 parent adb76ec commit d964d22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Parser.php
Expand Up @@ -34,6 +34,10 @@ public function parse(string $filename, Schema $schema, bool $ignoreFirstLine =
foreach ($schema->columnDefinitions() as $column => $definition) {
$value = $line[$column - 1];

if ($definition->type()->isBoolean()) {
$value = (bool) $value;
}

if ($definition->type()->isInteger()) {
$value = (int) $value;
}
Expand All @@ -42,10 +46,6 @@ public function parse(string $filename, Schema $schema, bool $ignoreFirstLine =
$value = (float) $value;
}

if ($definition->type()->isBoolean()) {
$value = (bool) $value;
}

$data[$definition->name()] = $value;
}

Expand Down

0 comments on commit d964d22

Please sign in to comment.