Skip to content

Commit

Permalink
Remove unused leading_zero_possible field
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Oct 28, 2022
1 parent d886563 commit 5c2965d
Show file tree
Hide file tree
Showing 584 changed files with 8 additions and 620 deletions.
5 changes: 0 additions & 5 deletions build/MetadataFilter.php
Expand Up @@ -49,7 +49,6 @@ class MetadataFilter
'nationalPrefixTransformRule',
'sameMobileAndFixedLinePattern',
'mainCountryForCode',
'leadingZeroPossible',
'mobileNumberPortableRegion'
);

Expand Down Expand Up @@ -316,10 +315,6 @@ public function filterMetadata(PhoneMetadata $metadata)
$metadata->clearMainCountryForCode();
}

if ($this->shouldDrop('leadingZeroPossible')) {
$metadata->clearLeadingZeroPossible();
}

if ($this->shouldDrop('mobileNumberPortableRegion')) {
$metadata->clearMobileNumberPortableRegion();
}
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
beStrictAboutTestsThatDoNotTestAnything="false"
convertWarningsToExceptions="true"
convertNoticesToExceptions="true"
convertErrorsToExceptions="true"
convertDeprecationsToExceptions="true"
colors="true">

<testsuites>
Expand Down
31 changes: 0 additions & 31 deletions src/PhoneMetadata.php
Expand Up @@ -25,7 +25,6 @@ class PhoneMetadata
protected $nationalPrefix;
protected $preferredExtnPrefix;
protected $mainCountryForCode = false;
protected $leadingZeroPossible = false;
protected $mobileNumberPortableRegion = false;
protected $generalDesc;
/**
Expand Down Expand Up @@ -118,11 +117,6 @@ public function clearMainCountryForCode()
return $this;
}

public function hasLeadingZeroPossible()
{
return $this->leadingZeroPossible !== null;
}

public function hasMobileNumberPortableRegion()
{
return $this->mobileNumberPortableRegion !== null;
Expand Down Expand Up @@ -288,10 +282,6 @@ public function toArray()
$output['leadingDigits'] = $this->getLeadingDigits();
}

if ($this->hasLeadingZeroPossible()) {
$output['leadingZeroPossible'] = $this->isLeadingZeroPossible();
}

if ($this->hasMobileNumberPortableRegion()) {
$output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
}
Expand Down Expand Up @@ -807,23 +797,6 @@ public function setLeadingDigits($value)
return $this;
}

public function isLeadingZeroPossible()
{
return $this->leadingZeroPossible;
}

public function setLeadingZeroPossible($value)
{
$this->leadingZeroPossible = $value;
return $this;
}

public function clearLeadingZeroPossible()
{
$this->leadingZeroPossible = false;
return $this;
}

public function isMobileNumberPortableRegion()
{
return $this->mobileNumberPortableRegion;
Expand Down Expand Up @@ -976,10 +949,6 @@ public function fromArray(array $input)
$this->setLeadingDigits($input['leadingDigits']);
}

if (isset($input['leadingZeroPossible'])) {
$this->setLeadingZeroPossible($input['leadingZeroPossible']);
}

if (isset($input['mobileNumberPortableRegion'])) {
$this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
}
Expand Down
2 changes: 1 addition & 1 deletion src/PhoneNumberUtil.php
Expand Up @@ -2813,7 +2813,7 @@ public function formatOutOfCountryCallingNumber(PhoneNumber $number, $regionCall
*/
public function isNANPACountry($regionCode)
{
return in_array(strtoupper($regionCode), $this->nanpaRegions);
return in_array(strtoupper((string)$regionCode), $this->nanpaRegions);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ShortNumberInfo.php
Expand Up @@ -130,7 +130,7 @@ public function getExampleShortNumber($regionCode)
*/
public function getMetadataForRegion($regionCode)
{
$regionCode = strtoupper($regionCode);
$regionCode = strtoupper((string)$regionCode);

if (!in_array($regionCode, ShortNumbersRegionCodeSet::$shortNumbersRegionCodeSet)) {
return null;
Expand Down
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_255.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_27.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_30.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_31.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_34.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_350.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_351.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_352.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_358.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_359.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_36.php
Expand Up @@ -46,6 +46,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_372.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_373.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_380.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_381.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_385.php
Expand Up @@ -71,6 +71,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_39.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_43.php
Expand Up @@ -179,6 +179,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_44.php
Expand Up @@ -83,6 +83,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_49.php
Expand Up @@ -515,6 +515,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_505.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_506.php
Expand Up @@ -34,6 +34,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_52.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_54.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_55.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_58.php
Expand Up @@ -34,6 +34,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_595.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_61.php
Expand Up @@ -68,6 +68,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_62.php
Expand Up @@ -95,6 +95,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_64.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_66.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_675.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_676.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_679.php
Expand Up @@ -35,6 +35,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_7.php
Expand Up @@ -95,6 +95,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_81.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_84.php
Expand Up @@ -59,6 +59,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_855.php
Expand Up @@ -34,6 +34,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_856.php
Expand Up @@ -56,6 +56,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);
1 change: 0 additions & 1 deletion src/data/PhoneNumberAlternateFormats_90.php
Expand Up @@ -47,6 +47,5 @@
array (
),
'mainCountryForCode' => false,
'leadingZeroPossible' => false,
'mobileNumberPortableRegion' => false,
);

0 comments on commit 5c2965d

Please sign in to comment.