Skip to content

Commit

Permalink
Clean up a couple things
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Feb 28, 2015
1 parent 20ba013 commit d83213c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions spec/Migrations/SchemaParserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ function it_parses_schema_with_multiple_fields_using_no_spaces()
['name' => 'name', 'type' => 'string', 'arguments' => [], 'options' => []],
['name' => 'age', 'type' => 'integer', 'arguments' => [], 'options' => []],
]);
}

function it_parses_schema_with_multiple_fields_containing_arguments_using_no_spaces()
{
$this->parse('name:string,amount:decimal(5,2)')->shouldReturn([
['name' => 'name', 'type' => 'string', 'arguments' => [], 'options' => []],
['name' => 'amount', 'type' => 'decimal', 'arguments' => ['5', '2'], 'options' => []]
Expand Down
4 changes: 1 addition & 3 deletions src/Migrations/SchemaParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public function parse($schema)
*/
private function getFields($schema)
{
$preg_split = preg_split('/,(?![^()]*+\\))/', $schema);

return array_map("trim", $preg_split);
return preg_split('/,\s?(?![^()]*\))/', $schema);
}

/**
Expand Down

0 comments on commit d83213c

Please sign in to comment.