1: <?php
2:
3: namespace ShippoClient\Http\Response;
4:
5: use ShippoClient\Entity\Address;
6: use ShippoClient\Entity\AddressCollection;
7: use TurmericSpice\Container;
8:
9: class AddressList extends ListResponse
10: {
11: /**
12: * @return AddressCollection
13: */
14: public function getResults()
15: {
16: $entities = [];
17: foreach ($this->attributes->mayHave('results')->asArray() as $attributes) {
18: $entities[] = new Address($attributes);
19: }
20:
21: return new AddressCollection($entities);
22: }
23: }
24: