Upstream metadata changes from Google for v8.13.27 #95
Annotations
10 warnings
Mutation tests (8.1, highest):
src/Matcher.php#L46
Escaped Mutant for Mutator "SharedCaseRemoval":
--- Original
+++ New
@@ @@
case 'lookingAt':
$final_pattern = '^' . $final_pattern;
break;
- case 'find':
default:
// no changes
break;
|
Mutation tests (8.1, highest):
src/Matcher.php#L46
Escaped Mutant for Mutator "SharedCaseRemoval":
--- Original
+++ New
@@ @@
$final_pattern = '^' . $final_pattern;
break;
case 'find':
- default:
// no changes
break;
}
|
Mutation tests (8.1, highest):
src/Matcher.php#L60
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
break;
}
$final_pattern = '/' . $final_pattern . '/ui';
- $search = mb_substr($this->subject, $offset);
+ $search = substr($this->subject, $offset);
$result = preg_match($final_pattern, $search, $groups, PREG_OFFSET_CAPTURE);
if ($result === 1) {
// Expand $groups into $this->groups, but being multi-byte aware
|
Mutation tests (8.1, highest):
src/Matcher.php#L72
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// Expand $groups into $this->groups, but being multi-byte aware
$positions = [];
foreach ($groups as $group) {
- $positions[] = [$group[0], $offset + mb_strlen(substr($search, 0, $group[1]))];
+ $positions[] = [$group[0], $offset + mb_strlen(substr($search, 1, $group[1]))];
}
$this->groups = $positions;
}
|
Mutation tests (8.1, highest):
src/Matcher.php#L72
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
// Expand $groups into $this->groups, but being multi-byte aware
$positions = [];
foreach ($groups as $group) {
- $positions[] = [$group[0], $offset + mb_strlen(substr($search, 0, $group[1]))];
+ $positions[] = [$group[0], $offset + strlen(substr($search, 0, $group[1]))];
}
$this->groups = $positions;
}
|
Mutation tests (8.1, highest):
src/Matcher.php#L99
Escaped Mutant for Mutator "Increment":
--- Original
+++ New
@@ @@
$offset = $this->searchIndex;
}
// Increment search index for the next time we call this
- $this->searchIndex++;
+ $this->searchIndex--;
return $this->doMatch('find', $offset);
}
public function groupCount() : ?int
|
Mutation tests (8.1, highest):
src/Matcher.php#L128
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if (!isset($this->groups[$group])) {
return null;
}
- return $this->groups[$group][1] + mb_strlen($this->groups[$group][0]);
+ return $this->groups[$group][1] + strlen($this->groups[$group][0]);
}
public function start(int $group = 0) : ?int
{
|
Mutation tests (8.1, highest):
src/MultiFileMetadataSourceImpl.php#L52
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
if (!array_key_exists($regionCode, $this->regionToMetadataMap)) {
// The regionCode here will be valid and won't be '001', so we don't need to worry about
// what to pass in for the country calling code.
- $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 0, $this->metadataLoader);
+ $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, -1, $this->metadataLoader);
}
return $this->regionToMetadataMap[$regionCode];
}
|
Mutation tests (8.1, highest):
src/MultiFileMetadataSourceImpl.php#L52
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
if (!array_key_exists($regionCode, $this->regionToMetadataMap)) {
// The regionCode here will be valid and won't be '001', so we don't need to worry about
// what to pass in for the country calling code.
- $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 0, $this->metadataLoader);
+ $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 1, $this->metadataLoader);
}
return $this->regionToMetadataMap[$regionCode];
}
|
Mutation tests (8.1, highest):
src/MultiFileMetadataSourceImpl.php#L78
Escaped Mutant for Mutator "UnwrapStrToUpper":
--- Original
+++ New
@@ @@
*/
public function loadMetadataFromFile(string $filePrefix, string $regionCode, int $countryCallingCode, MetadataLoaderInterface $metadataLoader) : void
{
- $regionCode = strtoupper($regionCode);
+ $regionCode = $regionCode;
$isNonGeoRegion = PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode;
$fileName = $filePrefix . '_' . ($isNonGeoRegion ? $countryCallingCode : $regionCode) . '.php';
if (!is_readable($fileName)) {
|