Skip to content

Commit d94c596

Browse files
authored
Merge pull request #4 from ctwillie/development
Merge v0.1.1 into master
2 parents 3593d4b + 440e3d9 commit d94c596

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@
22
/.vs
33
composer.lock
44
index.php
5-
notes.php
6-
todo.txt
7-
/src/Removed
85
dev-notes.txt

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ $address1 = [
7575
];
7676

7777
$address2 = [
78-
'Address2' => '6406 Ivy Lane',
79-
'City' => 'Greenbelt',
80-
'State' => 'MD',
81-
'Zip5' => 20770
78+
'Address2' => '2185 Sandy Drive',
79+
'City' => 'Franklin',
80+
'State' => 'VA',
81+
'Zip5' => 32050
8282
];
8383

8484
$addresses = new Address([$address1, $address2]);
@@ -88,6 +88,18 @@ $response = $addresses->validate();
8888

8989
The response will contain the [corrected address](https://www.usps.com/business/web-tools-apis/address-information-api.pdf), or an error if not enough information was given or the address does not exists.
9090

91+
## Response Formatting
92+
93+
You can specify the format of the response by passing an optional, case-insensitive parameter to the validate method. The default format is an associative array.
94+
95+
```php
96+
$address = new Address([/* address info */ ]);
97+
98+
$json = $address->validate('json');
99+
$object = $address->validate('object');
100+
$string = $address->validate('string');
101+
```
102+
91103
## Contributing
92104

93105
Contributions are always welcomed and will receive full credit.

0 commit comments

Comments
 (0)