Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ You can search addresses using either the `find` method for a single address or
The following optional attributes can be requested to be included in the response:

- `coordinates`: Includes latitude and longitude of the address.
- `district`: Includes the official and name of the district that the address belongs to.
- `district`: Includes the official and common name of the district that the address belongs to.
- `neighborhood`: Includes the official name of the neighborhood that the address belongs to.
- `function`: Includes the function of the address (e.g. residential, commercial, healthcare, etc.).
- `location_status`: Includes the location status of the address (e.g. active, in development, etc.).
- `property_status`: Includes the property status of the address (e.g. in use, under construction, etc.).
Expand All @@ -88,6 +89,7 @@ $address = $client->find(
addition: null,
attributes: [
AddressAttributesEnum::COORDINATES,
// more attributes can be added here
],
);
```
Expand All @@ -111,6 +113,7 @@ Address {
official: "Schiphol",
name: "Schiphol"
},
neighborhood: "Schiphol",
function: "kantoorfunctie",
location_status: "verblijfsobject in gebruik",
property_status: "pand in gebruik",
Expand Down
1 change: 1 addition & 0 deletions src/DTO/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function __construct(
public readonly string $country,
public readonly ?Coordinates $coordinates,
public readonly ?District $district,
public readonly ?string $neighborhood,
public readonly ?string $function,
public readonly ?string $location_status,
public readonly ?string $property_status,
Expand Down
1 change: 1 addition & 0 deletions src/Enums/AddressAttributesEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum AddressAttributesEnum: string
{
case COORDINATES = 'coordinates';
case DISTRICT = 'district';
case NEIGHBORHOOD = 'neighborhood';
case FUNCTION = 'function';
case LOCATION_STATUS = 'location_status';
case PROPERTY_STATUS = 'property_status';
Expand Down
1 change: 1 addition & 0 deletions src/Factories/AddressCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AddressCollectionFactory
* official: string,
* name: string,
* },
* neighborhood?: string,
* function?: string,
* location_status?: string,
* property_status?: string,
Expand Down
2 changes: 2 additions & 0 deletions src/Factories/AddressFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AddressFactory
* official: string,
* name: string,
* },
* neighborhood?: string,
* function?: string,
* location_status?: string,
* property_status?: string,
Expand Down Expand Up @@ -54,6 +55,7 @@ public static function make(array $attributes): Address
official: $attributes['details']['district']['official'],
name: $attributes['details']['district']['name'],
) : null,
neighborhood: $attributes['details']['neighborhood'] ?? null,
function: $attributes['details']['function'] ?? null,
location_status: $attributes['details']['location_status'] ?? null,
property_status: $attributes['details']['property_status'] ?? null,
Expand Down
5 changes: 5 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private function singleAddressResponse(): AddressCollection
latitude: 52.30528553688755,
longitude: 4.750645160863609,
),
neighborhood: null,
district: null,
function: null,
location_status: null,
Expand Down Expand Up @@ -124,6 +125,7 @@ private function multipleAddressesResponse(): AddressCollection
longitude: 4.889216673725493,
),
district: null,
neighborhood: null,
function: null,
location_status: null,
property_status: null,
Expand All @@ -144,6 +146,7 @@ function: null,
longitude: 4.889216673725493,
),
district: null,
neighborhood: null,
function: null,
location_status: null,
property_status: null,
Expand All @@ -164,6 +167,7 @@ function: null,
longitude: 4.889216673725493,
),
district: null,
neighborhood: null,
function: null,
location_status: null,
property_status: null,
Expand All @@ -184,6 +188,7 @@ function: null,
longitude: 4.889216673725493,
),
district: null,
neighborhood: null,
function: null,
location_status: null,
property_status: null,
Expand Down
Loading