Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Recca Tsai committed Feb 27, 2017
1 parent 4abd0c0 commit d00bffa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 88 deletions.
88 changes: 0 additions & 88 deletions old/tests/TwzipcodeTest.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ public function match($address)
$removeUnits = $this->removeUnits($ruleAddressTokens);

$address = is_a($address, Address::class) === true ? $address : new Address($address);

$addressTokens = new JArray($address->tokens()->filter(function ($token) use ($removeUnits) {
return isset($token[Address::UNIT]) && in_array($token[Address::UNIT], $removeUnits, true) === false;
})->values());

$address = new Address($addressTokens->map(function ($token) {
return implode('', $token);
})->join(''));
Expand Down

0 comments on commit d00bffa

Please sign in to comment.