Skip to content

Commit

Permalink
Fix conflixts strip countrycode prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rubentebogt committed Sep 20, 2024
2 parents c9a14fd + c501fa0 commit 6a111e0
Show file tree
Hide file tree
Showing 366 changed files with 13 additions and 1,647 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require-dev": {
"phpunit/phpunit": "^9.0",
"php-coveralls/php-coveralls": "^2.0",
"vimeo/psalm": "5.17.0"
"vimeo/psalm": "5.26.1"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/ADFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class ADFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (substr($postcode, 0, 2) === 'AD') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AFFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
*/
class AFFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AIFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class AIFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if ($postcode === '2640' || $postcode === 'AI2640') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/ALFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class ALFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AMFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class AMFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AQFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class AQFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if ($postcode === 'BIQQ1ZZ') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/ARFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class ARFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^(([0-9]{4})|([A-Z][0-9]{4}[A-Z]{3}))$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/ASFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class ASFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
$length = strlen($postcode);
Expand Down
8 changes: 3 additions & 5 deletions src/Formatter/ATFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Validates and formats postcodes in Austria.
*
* Postcodes consist of 4 digits, without separator.
* Postcodes consist of 4 digits, without separator. The first digit must be 1-9.
*
* @see https://en.wikipedia.org/wiki/List_of_postal_codes
* @see https://en.wikipedia.org/wiki/Postal_codes_in_Austria
Expand All @@ -19,14 +19,12 @@ class ATFormatter implements CountryPostcodeFormatter
{
use StripCountryCode;

/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
$postcode = $this->stripCountryCode($postcode);

if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
if (preg_match('/^[1-9][0-9]{3}$/', $postcode) !== 1) {

return null;
}

Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AUFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class AUFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AXFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class AXFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
$length = strlen($postcode);
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/AZFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class AZFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (substr($postcode, 0, 2) === 'AZ') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BAFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class BAFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{5}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BBFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class BBFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (substr($postcode, 0, 2) === 'BB') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BDFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class BDFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BEFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class BEFormatter implements CountryPostcodeFormatter
{
use StripCountryCode;

/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
$postcode = $this->stripCountryCode($postcode);
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BGFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class BGFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BHFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class BHFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^(1?[0-9])([0-9]{2})$/', $postcode, $matches) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BLFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class BLFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if ($postcode === '97133') {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BMFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class BMFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^([A-Z]{2})([A-Z]{2}|[0-9]{2})$/', $postcode, $matches) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BNFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class BNFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[A-Z]{2}[0-9]{4}$/', $postcode, $matches) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BRFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class BRFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{8}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BTFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class BTFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{5}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/BYFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class BYFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{6}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CAFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
*/
class CAFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^([ABCEGHJ-NPRSTV-Z][0-9]){3}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CCFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class CCFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CHFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
class CHFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CLFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class CLFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{7}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CNFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class CNFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{6}$/', $postcode) !== 1) {
Expand Down
4 changes: 0 additions & 4 deletions src/Formatter/COFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ class COFormatter implements CountryPostcodeFormatter
'99'
];

/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^\d{2}(?!0000)\d{4}$/', $postcode) !== 1) {
return null;
}


$department = substr($postcode, 0, 2);

if (!in_array($department, self::DEPARTMENTS, true)) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CRFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
*/
class CRFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]+$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CUFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class CUFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{5}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CVFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class CVFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CXFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
*/
class CXFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{4}$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CYFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
*/
class CYFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]+$/', $postcode) !== 1) {
Expand Down
3 changes: 0 additions & 3 deletions src/Formatter/CZFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
*/
class CZFormatter implements CountryPostcodeFormatter
{
/**
* {@inheritdoc}
*/
public function format(string $postcode) : ?string
{
if (preg_match('/^[0-9]{5}$/', $postcode) !== 1) {
Expand Down
Loading

0 comments on commit 6a111e0

Please sign in to comment.