mv/postal-address

Manage address in PHP, particulary AFNOR XPZ 10-011 for french postal address

1.0.0 2015-12-19 07:40 UTC

This package is auto-updated.

Last update: 2024-12-29 04:59:14 UTC


README

This library provide objects address, particulary for french address to have it in AFNOR XPZ 10-011 format output.

Install with composer

php composer.phar require mv/postal-address

Example

use Mv\PostalAddress\Address\French\Address as FrenchAddress;

$address = new FrenchAddress();

$address->setSociety('Ma Société');
$address->setService('Service compta');
$address->setStreetNumber('1 bis');
$address->setStreetType('Avenue');
$address->setStreetName('de la République');
$address->setBat('ZI des industries');
$address->setZipCode('75011');
$address->setCity('Paris');

echo $address;

This returns:

Ma Société
Service compta
ZI DES INDUSTRIES
1 BIS AVENUE DE LA RÉPUBLIQUE
75011 PARIS

Warning

This will throw Mv\PostalAddress\Exception\WrongAddressException when you try to set a property that is incompatible this another already set.

To be improved...