v9 upgrades #1
Annotations
10 warnings
Infection:
src/AsYouTypeFormatter.php#L142
Escaped Mutant for Mutator "TrueValue":
@@ @@
private static function init(): void
{
if (self::$initialised === false) {
- self::$initialised = true;
+ self::$initialised = false;
self::$emptyMetadata = new PhoneMetadata();
self::$emptyMetadata->setInternationalPrefix('NA');
self::$eligibleFormatPattern = '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*' . '\$1' . '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*(\$\d' . '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*)*';
|
Infection:
src/AsYouTypeFormatter.php#L163
Escaped Mutant for Mutator "UnwrapStrToUpper":
@@ @@
{
self::init();
$this->phoneUtil = PhoneNumberUtil::getInstance();
- $this->defaultCountry = strtoupper($regionCode);
+ $this->defaultCountry = $regionCode;
$this->currentMetadata = $this->getMetadataForRegion($this->defaultCountry);
$this->defaultMetadata = $this->currentMetadata;
}
|
Infection:
src/AsYouTypeFormatter.php#L214
Escaped Mutant for Mutator "FalseValue":
@@ @@
unset($this->possibleFormats[$key]);
}
$this->ableToFormat = false;
- return false;
+ return true;
}
private function getAvailableFormats(string $leadingDigits): void
{
|
Infection:
src/AsYouTypeFormatter.php#L250
Escaped Mutant for Mutator "Continue_":
@@ @@
continue;
}
if ($this->extractedNationalPrefix === '' && !$this->isCompleteNumber && !PhoneNumberUtil::formattingRuleHasFirstGroupOnly($format->getNationalPrefixFormattingRule()) && !$format->getNationalPrefixOptionalWhenFormatting()) {
- // This number was entered without a national prefix, and this formatting rule requires one,
- // so we discard it.
- continue;
+ break;
}
$eligibleFormatMatcher = new Matcher(self::$eligibleFormatPattern, $format->getFormat());
if ($eligibleFormatMatcher->matches()) {
|
Infection:
src/AsYouTypeFormatter.php#L264
Escaped Mutant for Mutator "MBString":
@@ @@
}
private function narrowDownPossibleFormats(string $leadingDigits): void
{
- $indexOfLeadingDigitsPattern = mb_strlen($leadingDigits) - self::$minLeadingDigitsLength;
+ $indexOfLeadingDigitsPattern = strlen($leadingDigits) - self::$minLeadingDigitsLength;
foreach ($this->possibleFormats as $key => $format) {
if ($format->leadingDigitsPatternSize() === 0) {
// Keep everything that isn't restricted by leading digits.
|
Infection:
src/AsYouTypeFormatter.php#L269
Escaped Mutant for Mutator "Continue_":
@@ @@
$indexOfLeadingDigitsPattern = mb_strlen($leadingDigits) - self::$minLeadingDigitsLength;
foreach ($this->possibleFormats as $key => $format) {
if ($format->leadingDigitsPatternSize() === 0) {
- // Keep everything that isn't restricted by leading digits.
- continue;
+ break;
}
$lastLeadingDigitsPattern = min($indexOfLeadingDigitsPattern, $format->leadingDigitsPatternSize() - 1);
$leadingDigitsPattern = $format->getLeadingDigitsPattern($lastLeadingDigitsPattern);
|
Infection:
src/AsYouTypeFormatter.php#L287
Escaped Mutant for Mutator "Assignment":
@@ @@
$this->formattingTemplate = '';
$tempTemplate = $this->getFormattingTemplate($numberPattern, $format->getFormat());
if ($tempTemplate !== '') {
- $this->formattingTemplate .= $tempTemplate;
+ $this->formattingTemplate = $tempTemplate;
return true;
}
return false;
|
Infection:
src/AsYouTypeFormatter.php#L307
Escaped Mutant for Mutator "MBString":
@@ @@
$aPhoneNumber = $m->group();
// No formatting template can be created if the number of digits entered entered so far
// is longer than the maximum the current formatting rule can accommodate.
- if (mb_strlen($aPhoneNumber) < mb_strlen($this->nationalNumber)) {
+ if (mb_strlen($aPhoneNumber) < strlen($this->nationalNumber)) {
return '';
}
// Formats the number according to $numberFormat
|
Infection:
src/AsYouTypeFormatter.php#L307
Escaped Mutant for Mutator "MBString":
@@ @@
$aPhoneNumber = $m->group();
// No formatting template can be created if the number of digits entered entered so far
// is longer than the maximum the current formatting rule can accommodate.
- if (mb_strlen($aPhoneNumber) < mb_strlen($this->nationalNumber)) {
+ if (strlen($aPhoneNumber) < mb_strlen($this->nationalNumber)) {
return '';
}
// Formats the number according to $numberFormat
|
Infection:
src/AsYouTypeFormatter.php#L307
Escaped Mutant for Mutator "LessThan":
@@ @@
$aPhoneNumber = $m->group();
// No formatting template can be created if the number of digits entered entered so far
// is longer than the maximum the current formatting rule can accommodate.
- if (mb_strlen($aPhoneNumber) < mb_strlen($this->nationalNumber)) {
+ if (mb_strlen($aPhoneNumber) <= mb_strlen($this->nationalNumber)) {
return '';
}
// Formats the number according to $numberFormat
|
Loading