Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.38 KB

Address.md

File metadata and controls

33 lines (23 loc) · 1.38 KB

Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks to say thank you to all libraries you use in your current project, this included!

Address Complex Value Object

Represents an address value. Offers some helping formatters to display the address.

Extends commerceguys/addressing.

How to use the object

See the working example: examples/Address.php.

use SerendipityHQ\Component\ValueObjects\Address\Address;
use SerendipityHQ\Component\ValueObjects\Address\AddressInterface;

$values = [
    AddressInterface::COUNTRY_CODE        => 'IT',
    AddressInterface::ADMINISTRATIVE_AREA => 'Salerno',
    AddressInterface::LOCALITY           => 'Nocera Inferiore',
    AddressInterface::POSTAL_CODE         => '84014',
    AddressInterface::STREET             => 'Via dalle scatole, 17',
    AddressInterface::EXTRA_LINE          => 'Interno 123'
];

$address = new Address($values);
dump($address);

Do you like this library? Leave a ★ or run composer global require symfony/thanks && composer thanks to say thank you to all libraries you use in your current project, this included!