Repository navigation
Fix STRICT_GROUPING rejecting numbers written without formatting - #772
Merged
giggsey merged 2 commits intoOct 26, 2026
Merged
Annotations
11 warnings and 1 notice
|
Complete job
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809, actions/checkout@v4. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
|
Infection:
src/AsYouTypeFormatter.php#L304
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#L304
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#L284
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#L266
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#L261
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#L247
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#L211
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#L192
Escaped Mutant for Mutator "ReturnRemoval":
@@ @@
foreach ($this->possibleFormats as $key => $numberFormat) {
$pattern = $numberFormat->getPattern();
if ($this->currentFormattingPattern === $pattern) {
- return false;
+
}
if ($this->createFormattingTemplate($numberFormat)) {
$this->currentFormattingPattern = $pattern;
|
|
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#L149
Escaped Mutant for Mutator "TrueValue":
@@ @@
self::$emptyMetadata = new PhoneMetadata();
self::$emptyMetadata->setInternationalPrefix('NA');
self::$eligibleFormatPattern = '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*' . '\$1' . '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*(\$\d' . '[' . PhoneNumberUtil::VALID_PUNCTUATION . ']*)*';
- self::$initialised = true;
+ self::$initialised = false;
}
}
/**
|
|
"The ubuntu-latest label will migrate to Ubuntu 26 beginning October 19, 2026. For more information, see https://github.com/actions/runner-images/issues/14748"
|
background
wait
wait-all
cancel
parallel
Loading