Skip to content

Commit 2003549

Browse files
committed
Document types in public methods
1 parent 98ea4c6 commit 2003549

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

src/PhoneNumberDesc.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,24 @@ public function clear()
3939
}
4040

4141
/**
42-
* @return array
42+
* @return int[]
4343
*/
4444
public function getPossibleLength()
4545
{
4646
return $this->possibleLength;
4747
}
4848

4949
/**
50-
* @param array $possibleLength
50+
* @param int[] $possibleLength
5151
*/
5252
public function setPossibleLength($possibleLength)
5353
{
5454
$this->possibleLength = $possibleLength;
5555
}
5656

57+
/**
58+
* @param int $possibleLength
59+
*/
5760
public function addPossibleLength($possibleLength)
5861
{
5962
if (!in_array($possibleLength, $this->possibleLength)) {
@@ -67,21 +70,24 @@ public function clearPossibleLength()
6770
}
6871

6972
/**
70-
* @return array
73+
* @return int[]
7174
*/
7275
public function getPossibleLengthLocalOnly()
7376
{
7477
return $this->possibleLengthLocalOnly;
7578
}
7679

7780
/**
78-
* @param array $possibleLengthLocalOnly
81+
* @param int[] $possibleLengthLocalOnly
7982
*/
8083
public function setPossibleLengthLocalOnly($possibleLengthLocalOnly)
8184
{
8285
$this->possibleLengthLocalOnly = $possibleLengthLocalOnly;
8386
}
8487

88+
/**
89+
* @param int $possibleLengthLocalOnly
90+
*/
8591
public function addPossibleLengthLocalOnly($possibleLengthLocalOnly)
8692
{
8793
if (!in_array($possibleLengthLocalOnly, $this->possibleLengthLocalOnly)) {

src/PhoneNumberUtil.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ public static function formattingRuleHasFirstGroupOnly($nationalPrefixFormatting
711711
/**
712712
* Returns all regions the library has metadata for.
713713
*
714-
* @return array An unordered array of the two-letter region codes for every geographical region the
714+
* @return string[] An unordered array of the two-letter region codes for every geographical region the
715715
* library supports
716716
*/
717717
public function getSupportedRegions()
@@ -722,7 +722,7 @@ public function getSupportedRegions()
722722
/**
723723
* Returns all global network calling codes the library has metadata for.
724724
*
725-
* @return array An unordered array of the country calling codes for every non-geographical entity
725+
* @return int[] An unordered array of the country calling codes for every non-geographical entity
726726
* the library supports
727727
*/
728728
public function getSupportedGlobalNetworkCallingCodes()
@@ -736,7 +736,7 @@ public function getSupportedGlobalNetworkCallingCodes()
736736
* used to populate a drop-down box of country calling codes for a phone-number widget, for
737737
* instance.
738738
*
739-
* @return array An unordered array of the country calling codes for every geographical and
739+
* @return int[] An unordered array of the country calling codes for every geographical and
740740
* non-geographical entity the library supports
741741
*/
742742
public function getSupportedCallingCodes()
@@ -804,7 +804,7 @@ private function getSupportedTypesForMetadata(PhoneMetadata $metadata)
804804
* No types will be returned for invalid or unknown region codes.
805805
*
806806
* @param string $regionCode
807-
* @return array
807+
* @return (PhoneNumberType::*)[]
808808
*/
809809
public function getSupportedTypesForRegion($regionCode)
810810
{
@@ -822,7 +822,7 @@ public function getSupportedTypesForRegion($regionCode)
822822
* present) and UNKNOWN.
823823
*
824824
* @param int $countryCallingCode
825-
* @return array
825+
* @return (PhoneNumberType::*)[]
826826
*/
827827
public function getSupportedTypesForNonGeoEntity($countryCallingCode)
828828
{
@@ -2447,7 +2447,7 @@ protected function testNumberLength($number, PhoneMetadata $metadata, $type = Ph
24472447
* non-geographical country calling codes, the region code 001 is returned. Also, in the case
24482448
* of no region code being found, an empty list is returned.
24492449
* @param int $countryCallingCode
2450-
* @return array
2450+
* @return string[]
24512451
*/
24522452
public function getRegionCodesForCountryCode($countryCallingCode)
24532453
{
@@ -3190,7 +3190,7 @@ public function parse($numberToParse, $defaultRegion = null, ?PhoneNumber $phone
31903190
*
31913191
* @param PhoneNumber $number the phone number to be formatted
31923192
* @param int $numberFormat the format the phone number should be formatted into
3193-
* @param array $userDefinedFormats formatting rules specified by clients
3193+
* @param NumberFormat[] $userDefinedFormats formatting rules specified by clients
31943194
* @return String the formatted phone number
31953195
*/
31963196
public function formatByPattern(PhoneNumber $number, $numberFormat, array $userDefinedFormats)

src/ShortNumberInfo.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function resetInstance()
7070
* of no region code being found, an empty list is returned.
7171
*
7272
* @param int $countryCallingCode
73-
* @return array
73+
* @return string[]
7474
*/
7575
protected function getRegionCodesForCountryCode($countryCallingCode)
7676
{

0 commit comments

Comments
 (0)