Skip to content

Commit

Permalink
Merge pull request #107 from iGusev/private-to-protected
Browse files Browse the repository at this point in the history
Refactored some classes for extending in other libraries
  • Loading branch information
giggsey committed May 3, 2016
2 parents db2f9b1 + 6ed0e75 commit bc982d7
Show file tree
Hide file tree
Showing 17 changed files with 320 additions and 320 deletions.
8 changes: 4 additions & 4 deletions src/libphonenumber/Matcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ class Matcher
/**
* @var string
*/
private $pattern;
protected $pattern;

/**
* @var string
*/
private $subject;
protected $subject;

/**
* @var array
*/
private $groups = array();
protected $groups = array();

/**
* @param string $pattern
Expand All @@ -36,7 +36,7 @@ public function __construct($pattern, $subject)
$this->subject = $subject;
}

private function doMatch($type = 'find')
protected function doMatch($type = 'find')
{
$final_pattern = '(?:' . $this->pattern . ')';
switch ($type) {
Expand Down
12 changes: 6 additions & 6 deletions src/libphonenumber/MultiFileMetadataSourceImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,34 @@

class MultiFileMetadataSourceImpl implements MetadataSourceInterface
{
private static $metaDataFilePrefix = PhoneNumberUtil::META_DATA_FILE_PREFIX;
protected static $metaDataFilePrefix = PhoneNumberUtil::META_DATA_FILE_PREFIX;

/**
* A mapping from a region code to the PhoneMetadata for that region.
* @var PhoneMetadata[]
*/
private $regionToMetadataMap = array();
protected $regionToMetadataMap = array();

/**
* A mapping from a country calling code for a non-geographical entity to the PhoneMetadata for
* that country calling code. Examples of the country calling codes include 800 (International
* Toll Free Service) and 808 (International Shared Cost Service).
* @var PhoneMetadata[]
*/
private $countryCodeToNonGeographicalMetadataMap = array();
protected $countryCodeToNonGeographicalMetadataMap = array();

/**
* The prefix of the metadata files from which region data is loaded.
* @var String
*/
private $currentFilePrefix;
protected $currentFilePrefix;


/**
* The metadata loader used to inject alternative metadata sources.
* @var MetadataLoaderInterface
*/
private $metadataLoader;
protected $metadataLoader;

/**
* @param MetadataLoaderInterface $metadataLoader
Expand All @@ -48,7 +48,7 @@ class MultiFileMetadataSourceImpl implements MetadataSourceInterface
public function __construct(MetadataLoaderInterface $metadataLoader, $currentFilePrefix = null)
{
if ($currentFilePrefix === null) {
$currentFilePrefix = self::$metaDataFilePrefix;
$currentFilePrefix = static::$metaDataFilePrefix;
}

$this->currentFilePrefix = $currentFilePrefix;
Expand Down
10 changes: 5 additions & 5 deletions src/libphonenumber/NumberFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
class NumberFormat
{
private $pattern = null;
private $format = null;
private $leadingDigitsPattern = array();
private $nationalPrefixFormattingRule = null;
private $domesticCarrierCodeFormattingRule = null;
protected $pattern = null;
protected $format = null;
protected $leadingDigitsPattern = array();
protected $nationalPrefixFormattingRule = null;
protected $domesticCarrierCodeFormattingRule = null;

/**
* @return boolean
Expand Down
2 changes: 1 addition & 1 deletion src/libphonenumber/NumberParseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class NumberParseException extends \Exception
// This indicates the string had more digits than any valid phone number could have.
const TOO_LONG = 4;

private $errorType;
protected $errorType;

public function __construct($errorType, $message, $previous = null)
{
Expand Down
62 changes: 31 additions & 31 deletions src/libphonenumber/PhoneMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PhoneMetadata
/**
* @var string
*/
private $id = null;
protected $id = null;

/**
* @return boolean
Expand Down Expand Up @@ -39,7 +39,7 @@ public function setId($value)
/**
* @var int
*/
private $countryCode = null;
protected $countryCode = null;

/**
* @return boolean
Expand Down Expand Up @@ -67,7 +67,7 @@ public function setCountryCode($value)
return $this;
}

private $leadingDigits = null;
protected $leadingDigits = null;

/**
* @return bool
Expand All @@ -88,7 +88,7 @@ public function setLeadingDigits($value)
return $this;
}

private $internationalPrefix = null;
protected $internationalPrefix = null;

public function hasInternationalPrefix()
{
Expand All @@ -106,7 +106,7 @@ public function setInternationalPrefix($value)
return $this;
}

private $preferredInternationalPrefix = null;
protected $preferredInternationalPrefix = null;

public function hasPreferredInternationalPrefix()
{
Expand All @@ -124,7 +124,7 @@ public function setPreferredInternationalPrefix($value)
return $this;
}

private $nationalPrefixForParsing = null;
protected $nationalPrefixForParsing = null;

public function hasNationalPrefixForParsing()
{
Expand All @@ -142,7 +142,7 @@ public function setNationalPrefixForParsing($value)
return $this;
}

private $nationalPrefixTransformRule = null;
protected $nationalPrefixTransformRule = null;

public function hasNationalPrefixTransformRule()
{
Expand All @@ -160,7 +160,7 @@ public function setNationalPrefixTransformRule($value)
return $this;
}

private $nationalPrefix = null;
protected $nationalPrefix = null;

public function hasNationalPrefix()
{
Expand All @@ -178,7 +178,7 @@ public function setNationalPrefix($value)
return $this;
}

private $preferredExtnPrefix = null;
protected $preferredExtnPrefix = null;

public function hasPreferredExtnPrefix()
{
Expand All @@ -196,7 +196,7 @@ public function setPreferredExtnPrefix($value)
return $this;
}

private $mainCountryForCode = false;
protected $mainCountryForCode = false;

public function hasMainCountryForCode()
{
Expand All @@ -219,7 +219,7 @@ public function setMainCountryForCode($value)
return $this;
}

private $leadingZeroPossible = false;
protected $leadingZeroPossible = false;

public function hasLeadingZeroPossible()
{
Expand All @@ -237,7 +237,7 @@ public function setLeadingZeroPossible($value)
return $this;
}

private $mobileNumberPortableRegion = false;
protected $mobileNumberPortableRegion = false;

public function hasMobileNumberPortableRegion()
{
Expand All @@ -255,7 +255,7 @@ public function setMobileNumberPortableRegion($value)
return $this;
}

private $generalDesc = null;
protected $generalDesc = null;

public function hasGeneralDesc()
{
Expand All @@ -279,7 +279,7 @@ public function setGeneralDesc(PhoneNumberDesc $value)
/**
* @var PhoneNumberDesc
*/
private $mobile = null;
protected $mobile = null;

public function hasMobile()
{
Expand All @@ -300,7 +300,7 @@ public function setMobile(PhoneNumberDesc $value)
return $this;
}

private $premiumRate = null;
protected $premiumRate = null;

public function hasPremiumRate()
{
Expand All @@ -321,7 +321,7 @@ public function setPremiumRate(PhoneNumberDesc $value)
return $this;
}

private $fixedLine = null;
protected $fixedLine = null;

public function hasFixedLine()
{
Expand All @@ -342,7 +342,7 @@ public function setFixedLine(PhoneNumberDesc $value)
return $this;
}

private $sameMobileAndFixedLinePattern = false;
protected $sameMobileAndFixedLinePattern = false;

public function hasSameMobileAndFixedLinePattern()
{
Expand All @@ -360,7 +360,7 @@ public function setSameMobileAndFixedLinePattern($value)
return $this;
}

private $numberFormat = array();
protected $numberFormat = array();

/**
* @return NumberFormat[]
Expand Down Expand Up @@ -390,7 +390,7 @@ public function addNumberFormat(NumberFormat $value)
return $this;
}

private $tollFree = null;
protected $tollFree = null;

public function hasTollFree()
{
Expand All @@ -411,7 +411,7 @@ public function setTollFree(PhoneNumberDesc $value)
return $this;
}

private $sharedCost = null;
protected $sharedCost = null;

public function hasSharedCost()
{
Expand All @@ -432,7 +432,7 @@ public function setSharedCost(PhoneNumberDesc $value)
return $this;
}

private $personalNumber;
protected $personalNumber;

public function hasPersonalNumber()
{
Expand All @@ -453,7 +453,7 @@ public function setPersonalNumber(PhoneNumberDesc $value)
return $this;
}

private $voip;
protected $voip;

public function hasVoip()
{
Expand All @@ -474,7 +474,7 @@ public function setVoip(PhoneNumberDesc $value)
return $this;
}

private $pager;
protected $pager;

public function hasPager()
{
Expand All @@ -495,7 +495,7 @@ public function setPager(PhoneNumberDesc $value)
return $this;
}

private $uan;
protected $uan;

public function hasUan()
{
Expand All @@ -516,7 +516,7 @@ public function setUan(PhoneNumberDesc $value)
return $this;
}

private $emergency;
protected $emergency;

public function hasEmergency()
{
Expand All @@ -537,7 +537,7 @@ public function setEmergency(PhoneNumberDesc $value)
return $this;
}

private $voicemail;
protected $voicemail;

public function hasVoicemail()
{
Expand All @@ -561,7 +561,7 @@ public function setVoicemail(PhoneNumberDesc $value)
/**
* @var PhoneNumberDesc
*/
private $short_code;
protected $short_code;

public function hasShortCode()
{
Expand All @@ -582,7 +582,7 @@ public function setShortCode(PhoneNumberDesc $value)
/**
* @var PhoneNumberDesc
*/
private $standard_rate;
protected $standard_rate;

public function hasStandardRate()
{
Expand All @@ -603,7 +603,7 @@ public function setStandardRate(PhoneNumberDesc $value)
/**
* @var PhoneNumberDesc
*/
private $carrierSpecific;
protected $carrierSpecific;

public function hasCarrierSpecific()
{
Expand All @@ -624,7 +624,7 @@ public function setCarrierSpecific(PhoneNumberDesc $value)
/**
* @var PhoneNumberDesc
*/
private $noInternationalDialling = null;
protected $noInternationalDialling = null;

public function hasNoInternationalDialling()
{
Expand All @@ -646,7 +646,7 @@ public function setNoInternationalDialling(PhoneNumberDesc $value)
*
* @var NumberFormat[]
*/
private $intlNumberFormat = array();
protected $intlNumberFormat = array();

public function intlNumberFormats()
{
Expand Down
Loading

0 comments on commit bc982d7

Please sign in to comment.