Skip to content

2.1.0

Choose a tag to compare

@zerodahero zerodahero released this 08 Jan 20:40

Added in strict mode parsing. Now, you can parse from a 5-part address. The normalizer can be set to strict mode to return false on failed normalization (default) or with strict mode off, the 5-part parse will return a simple address object. The primary use case is when you have strange (but presumably correct) formatting that may trick the normalizer (like extra commas or duplicate unit info), but would still like to hash or use the output methods.

$normalizer = new Normalizer(['strict_mode' => false]);
// returns an Address if normalized or Simple Address if normalization fails
$address = $normalizer->parseFromComponents($address1, $address2, $city, $state, $zip); 
$normalizer = new Normalizer(['strict_mode' => true]); // or omit, strict mode on is the default
// returns an Address if normalized or false if normalization fails
$address = $normalizer->parseFromComponents($address1, $address2, $city, $state, $zip);