Skip to content

Commit

Permalink
Increase tests coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 6, 2019
1 parent 3fd3392 commit 5178e8e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Importer/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ private function parse(string $subject)

\preg_match_all('~[^\[\]]+|\[(?<nested>(?R)*)\]~', $subject, $matches);

if (null === $matches = \array_filter($matches['nested'])) {
$matches = [];
}
$matches = (array) $matches['nested'];

foreach ($matches as $match) {
foreach (\array_filter($matches) as $match) {
$item = [];
$position = \strpos($match, '[');

Expand Down

0 comments on commit 5178e8e

Please sign in to comment.