Skip to content

v9 upgrades

v9 upgrades #1

Triggered via pull request March 9, 2025 14:21
@giggseygiggsey
synchronize #677
v9-upgrades
Status Success
Total duration 4m 42s
Artifacts

mutation-tests.yml

on: pull_request
Matrix: Mutation tests
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Mutation tests (8.4, highest): 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 . ']*)*';
Mutation tests (8.4, highest): 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; }
Mutation tests (8.4, highest): 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 {
Mutation tests (8.4, highest): 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()) {
Mutation tests (8.4, highest): 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.
Mutation tests (8.4, highest): 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);
Mutation tests (8.4, highest): 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;
Mutation tests (8.4, highest): 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
Mutation tests (8.4, highest): 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
Mutation tests (8.4, highest): 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