Property | Type | Description | |
---|---|---|---|
$addressFormatRepository | CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface | The address format repository. | |
$subdivisionRepository | CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface | The subdivision repository. |
Method | Description | |
---|---|---|
__construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface $subdivisionRepository = null ) | Creates an AddressFormatValidator instance. | |
validate ( $value, |
Method | Description | |
---|---|---|
addViolation ( string $field, string $message, mixed $invalidValue, |
Adds a violation. | |
extractAddressValues ( CommerceGuys\Addressing\AddressInterface $address ) : array | Extracts the address values. | |
validateFields ( array $values, |
Validates the provided field values. | |
validatePostalCode ( string $postalCode, array $subdivisions, |
Validates the provided postal code. | |
validateSubdivisions ( array $values, |
Validates the provided subdivision values. |
public __construct ( CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface $addressFormatRepository = null, CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface $subdivisionRepository = null ) | ||
$addressFormatRepository | CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface | |
$subdivisionRepository | CommerceGuys\Addressing\Subdivision\SubdivisionRepositoryInterface |
protected addViolation ( string $field, string $message, mixed $invalidValue, |
||
$field | string | The field. |
$message | string | The error message. |
$invalidValue | mixed | The invalid, validated value. |
$addressFormat | The address format. |
protected extractAddressValues ( CommerceGuys\Addressing\AddressInterface $address ) : array | ||
$address | CommerceGuys\Addressing\AddressInterface | The address. |
return | array | An array of values keyed by field constants. |
public validate ( $value, |
||
$constraint |
protected validateFields ( array $values, |
||
$values | array | The field values, keyed by field constants. |
$addressFormat | The address format. | |
$constraint | The constraint. |
protected validatePostalCode ( string $postalCode, array $subdivisions, |
||
$postalCode | string | The postal code. |
$subdivisions | array | An array of found valid subdivisions. |
$addressFormat | The address format. | |
$constraint | The constraint. |
protected validateSubdivisions ( array $values, |
||
$values | array | The field values, keyed by field constants. |
$addressFormat | The address format. | |
$constraint | The constraint. | |
return | array | An array of found valid subdivisions. |
protected AddressFormatRepositoryInterface,CommerceGuys\Addressing\AddressFormat $addressFormatRepository | ||
return | CommerceGuys\Addressing\AddressFormat\AddressFormatRepositoryInterface |