Skip to content

Commit

Permalink
address error exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Reindert committed Jul 6, 2017
1 parent af8b99d commit 6ebc0d1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Model/Repository/MyParcelConsignmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ private function splitStreet($fullStreet)

$result = preg_match(self::SPLIT_STREET_REGEX, $fullStreet, $matches);

if (!$result || !is_array($matches) || $fullStreet != $matches[0]) {
if ($fullStreet != $matches[0]) {
// Characters are gone by preg_match
throw new \Exception('Something went wrong with splitting up address ' . $fullStreet);
} else {
// Invalid full street supplied
throw new \Exception('Invalid full street supplied: ' . $fullStreet);
}
if (!$result || !is_array($matches)) {
// Invalid full street supplied
throw new \Exception('Invalid full street supplied: ' . $fullStreet);
}

if ($fullStreet != $matches[0]) {
// Characters are gone by preg_match
throw new \Exception('Something went wrong with splitting up address ' . $fullStreet);
}

if (isset($matches['street'])) {
Expand Down

0 comments on commit 6ebc0d1

Please sign in to comment.