@@ -1219,7 +1219,7 @@ public function format(PhoneNumber $number, $numberFormat)
1219
1219
// TODO: Consider removing the 'if' above so that unparseable
1220
1220
// strings without raw input format to the empty string instead of "+00"
1221
1221
$ rawInput = $ number ->getRawInput ();
1222
- if (mb_strlen ( $ rawInput) > 0 ) {
1222
+ if ($ rawInput !== '' ) {
1223
1223
return $ rawInput ;
1224
1224
}
1225
1225
}
@@ -1668,7 +1668,7 @@ protected function parseHelper($numberToParse, $defaultRegion, $keepRawInput, $c
1668
1668
// Attempt to parse extension first, since it doesn't require region-specific data and we want
1669
1669
// to have the non-normalised number here.
1670
1670
$ extension = $ this ->maybeStripExtension ($ nationalNumber );
1671
- if (mb_strlen ( $ extension) > 0 ) {
1671
+ if ($ extension !== '' ) {
1672
1672
$ phoneNumber ->setExtension ($ extension );
1673
1673
}
1674
1674
@@ -1744,7 +1744,7 @@ protected function parseHelper($numberToParse, $defaultRegion, $keepRawInput, $c
1744
1744
&& $ validationResult !== ValidationResult::IS_POSSIBLE_LOCAL_ONLY
1745
1745
&& $ validationResult !== ValidationResult::INVALID_LENGTH ) {
1746
1746
$ normalizedNationalNumber = $ potentialNationalNumber ;
1747
- if ($ keepRawInput && mb_strlen ( $ carrierCode) > 0 ) {
1747
+ if ($ keepRawInput && $ carrierCode !== '' ) {
1748
1748
$ phoneNumber ->setPreferredDomesticCarrierCode ($ carrierCode );
1749
1749
}
1750
1750
}
@@ -2450,7 +2450,7 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling
2450
2450
// Historically, we set this to an empty string when parsing with raw input if none was
2451
2451
// found in the input string. However, this doesn't result in a number we can dial. For this
2452
2452
// reason, we treat the empty string the same as if it isn't set at all.
2453
- $ formattedNumber = mb_strlen ( $ numberNoExt ->getPreferredDomesticCarrierCode ()) > 0
2453
+ $ formattedNumber = $ numberNoExt ->getPreferredDomesticCarrierCode () !== ''
2454
2454
? $ this ->formatNationalNumberWithPreferredCarrierCode ($ numberNoExt , '' )
2455
2455
// Brazilian fixed line and mobile numbers need to be dialed with a carrier code when
2456
2456
// called within Brazil. Without that, most of the carriers won't connect the call.
@@ -2804,7 +2804,7 @@ public function formatOutOfCountryCallingNumber(PhoneNumber $number, $regionCall
2804
2804
PhoneNumberFormat::INTERNATIONAL ,
2805
2805
$ formattedNumber
2806
2806
);
2807
- if (mb_strlen ( $ internationalPrefixForFormatting) > 0 ) {
2807
+ if ($ internationalPrefixForFormatting !== '' ) {
2808
2808
$ formattedNumber = $ internationalPrefixForFormatting . ' ' . $ countryCallingCode . ' ' . $ formattedNumber ;
2809
2809
} else {
2810
2810
$ this ->prefixNumberWithCountryCallingCode (
0 commit comments