Skip to content

Commit

Permalink
Make the administrative area required for BB, CL, CV, EG, IR, KI, MY,…
Browse files Browse the repository at this point in the history
… PE, TH, VN.

Fixes #205.
  • Loading branch information
bojanz committed Feb 25, 2024
1 parent 1ed5f7c commit a5af40b
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/AddressFormat/AddressFormatRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ protected function getDefinitions(): array
],
'BB' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%locality, %administrativeArea %postalCode",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'administrative_area_type' => 'parish',
'postal_code_pattern' => 'BB\d{5}',
'subdivision_depth' => 1,
Expand Down Expand Up @@ -301,6 +304,9 @@ protected function getDefinitions(): array
],
'CL' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%postalCode %locality\n%administrativeArea",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'administrative_area_type' => 'region',
'postal_code_pattern' => '\d{7}',
'subdivision_depth' => 2,
Expand Down Expand Up @@ -343,6 +349,9 @@ protected function getDefinitions(): array
],
'CV' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%postalCode %locality\n%administrativeArea",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'administrative_area_type' => 'island',
'postal_code_pattern' => '\d{4}',
'subdivision_depth' => 1,
Expand Down Expand Up @@ -405,6 +414,9 @@ protected function getDefinitions(): array
],
'EG' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%locality\n%administrativeArea\n%postalCode",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'postal_code_pattern' => '\d{5}',
'subdivision_depth' => 1,
],
Expand Down Expand Up @@ -685,6 +697,9 @@ protected function getDefinitions(): array
],
'IR' => [
'format' => "%organization\n%givenName %familyName\n%administrativeArea\n%locality, %dependentLocality\n%addressLine1\n%addressLine2\n%addressLine3\n%postalCode",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'dependent_locality_type' => 'neighborhood',
'postal_code_pattern' => '\d{5}-?\d{5}',
'subdivision_depth' => 1,
Expand Down Expand Up @@ -754,6 +769,9 @@ protected function getDefinitions(): array
],
'KI' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%administrativeArea\n%locality",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'uppercase_fields' => [
'addressLine1', 'addressLine2', 'addressLine3', 'locality', 'familyName', 'additionalName', 'givenName', 'organization', 'administrativeArea',
],
Expand Down Expand Up @@ -995,7 +1013,7 @@ protected function getDefinitions(): array
'MY' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%dependentLocality\n%postalCode %locality\n%administrativeArea",
'required_fields' => [
'addressLine1', 'locality', 'postalCode',
'addressLine1', 'locality', 'administrativeArea', 'postalCode',
],
'uppercase_fields' => [
'locality', 'administrativeArea',
Expand Down Expand Up @@ -1101,6 +1119,9 @@ protected function getDefinitions(): array
],
'PE' => [
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%locality %postalCode\n%administrativeArea",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'locality_type' => 'district',
'postal_code_pattern' => '[0-2]\d{4}',
'subdivision_depth' => 1,
Expand Down Expand Up @@ -1379,6 +1400,9 @@ protected function getDefinitions(): array
'locale' => 'th',
'format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%dependentLocality, %locality\n%administrativeArea %postalCode",
'local_format' => "%givenName %familyName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%dependentLocality %locality\n%administrativeArea %postalCode",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'uppercase_fields' => [
'administrativeArea',
],
Expand Down Expand Up @@ -1519,6 +1543,9 @@ protected function getDefinitions(): array
],
'VN' => [
'format' => "%familyName %givenName\n%organization\n%addressLine1\n%addressLine2\n%addressLine3\n%locality\n%administrativeArea %postalCode",
'required_fields' => [
'addressLine1', 'locality', 'administrativeArea',
],
'postal_code_pattern' => '\d{5}\d?',
'subdivision_depth' => 1,
],
Expand Down

0 comments on commit a5af40b

Please sign in to comment.