rewrite Headers #3124
Annotations
1 error and 10 warnings
Run mutation tests with infection/infection
Process completed with exit code 1.
|
Run mutation tests with infection/infection:
src/Detector.php#L187
Escaped Mutant for Mutator "UnwrapArrayChangeKeyCase":
@@ @@
// },
// array: $request->getHeaders()
// ));
- return ['headers' => array_map(callback: static fn(HeaderInterface $header): string => $header->getValue(), array: array_change_key_case($request->getHeaders(), CASE_LOWER)), 'device' => ['architecture' => $this->getDeviceArchitecture($filteredHeaders), 'deviceName' => $device->getDeviceName(), 'marketingName' => $device->getMarketingName(), 'manufacturer' => $device->getManufacturer()->getType(), 'brand' => $device->getBrand()->getType(), 'dualOrientation' => $device->getDualOrientation(), 'simCount' => $device->getSimCount(), 'display' => $device->getDisplay()->toArray(), 'type' => $device->getType()->getType(), 'ismobile' => $deviceIsMobile ?? $device->getType()->isMobile(), 'istv' => $device->getType()->isTv(), 'bits' => $this->getDeviceBitness($filteredHeaders)], 'os' => ['name' => $platformName, 'marketingName' => $platformMarketingName, 'version' => $platform->getVersion()->getVersion(), 'manufacturer' => $platform->getManufacturer()->getType()], 'client' => ['name' => $client->getName(), 'version' => $client->getVersion()->getVersion(), 'manufacturer' => $client->getManufacturer()->getType(), 'type' => $client->getType()->getType(), 'isbot' => $client->getType()->isBot()], 'engine' => ['name' => $engine->getName(), 'version' => $engine->getVersion()->getVersion(), 'manufacturer' => $engine->getManufacturer()->getType()]];
+ return ['headers' => array_map(callback: static fn(HeaderInterface $header): string => $header->getValue(), array: $request->getHeaders()), 'device' => ['architecture' => $this->getDeviceArchitecture($filteredHeaders), 'deviceName' => $device->getDeviceName(), 'marketingName' => $device->getMarketingName(), 'manufacturer' => $device->getManufacturer()->getType(), 'brand' => $device->getBrand()->getType(), 'dualOrientation' => $device->getDualOrientation(), 'simCount' => $device->getSimCount(), 'display' => $device->getDisplay()->toArray(), 'type' => $device->getType()->getType(), 'ismobile' => $deviceIsMobile ?? $device->getType()->isMobile(), 'istv' => $device->getType()->isTv(), 'bits' => $this->getDeviceBitness($filteredHeaders)], 'os' => ['name' => $platformName, 'marketingName' => $platformMarketingName, 'version' => $platform->getVersion()->getVersion(), 'manufacturer' => $platform->getManufacturer()->getType()], 'client' => ['name' => $client->getName(), 'version' => $client->getVersion()->getVersion(), 'manufacturer' => $client->getManufacturer()->getType(), 'type' => $client->getType()->getType(), 'isbot' => $client->getType()->isBot()], 'engine' => ['name' => $engine->getName(), 'version' => $engine->getVersion()->getVersion(), 'manufacturer' => $engine->getManufacturer()->getType()]];
}
/** @throws NotNumericException */
private function getVersion(string|null $inputVersion): VersionInterface
|
Run mutation tests with infection/infection:
src/Detector.php#L530
Escaped Mutant for Mutator "FalseValue":
@@ @@
}
if (is_string($platformVersion)) {
$derivatePosition = mb_strpos($platformVersion, ';');
- if ($derivatePosition !== false) {
+ if ($derivatePosition !== true) {
// the platform contains information about a derivate of the platform
$derivate = trim(mb_substr($platformVersion, $derivatePosition + 1));
$platformVersion = null;
|
Run mutation tests with infection/infection:
src/Detector.php#L565
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
$this->logger->info($e);
}
}
- if (!$platformVersion instanceof VersionInterface) {
+ if (!true) {
$platformVersion = null;
}
return new Os(name: null, marketingName: null, manufacturer: new Company(type: 'unknown', name: null, brandname: null), version: $platformVersion ?? new NullVersion());
|
Run mutation tests with infection/infection:
src/DetectorFactory.php#L63
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
{
if ($this->detector === null) {
$companyLoaderFactory = new CompanyLoaderFactory();
- $serializableStrategy = new SerializableStrategy(new Json(['objectDecodeType' => \Laminas\Json\Json::TYPE_ARRAY]));
+ $serializableStrategy = new SerializableStrategy(new Json([]));
$companyLoader = $companyLoaderFactory($serializableStrategy);
try {
$platformLoader = new PlatformLoader(logger: $this->logger, initData: new Data\Os(strategy: new StrategyChain([new CollectionStrategy(new ArraySerializableHydrator(), DataOs::class), $serializableStrategy])), companyLoader: $companyLoader, versionBuilder: new VersionBuilder());
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L75
Escaped Mutant for Mutator "LogicalAnd":
@@ @@
{
$file = $this->getInnerIterator()->current();
assert($file instanceof SplFileInfo);
- return $file->isFile() && $file->getExtension() === $this->extension;
+ return $file->isFile() || $file->getExtension() === $this->extension;
}
};
foreach ($files as $file) {
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L83
Escaped Mutant for Mutator "UnwrapStrReplace":
@@ @@
foreach ($files as $file) {
assert($file instanceof SplFileInfo);
$pathName = $file->getPathname();
- $filepath = str_replace('\\', '/', $pathName);
+ $filepath = $pathName;
assert(is_string($filepath));
$content = @file_get_contents($filepath);
if ($content === false) {
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L88
Escaped Mutant for Mutator "FalseValue":
@@ @@
$filepath = str_replace('\\', '/', $pathName);
assert(is_string($filepath));
$content = @file_get_contents($filepath);
- if ($content === false) {
+ if ($content === true) {
throw new RuntimeException(sprintf('could not read file "%s"', $file));
}
$fileData = $this->strategy->hydrate($content, []);
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L97
Escaped Mutant for Mutator "CastString":
@@ @@
$fileData = $this->strategy->hydrate($content, []);
assert(is_array($fileData));
foreach ($fileData as $key => $data) {
- $stringKey = (string) $key;
+ $stringKey = $key;
if (array_key_exists($stringKey, $this->items) || !$data instanceof DataClient) {
continue;
}
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L99
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
assert(is_array($fileData));
foreach ($fileData as $key => $data) {
$stringKey = (string) $key;
- if (array_key_exists($stringKey, $this->items) || !$data instanceof DataClient) {
+ if (array_key_exists($stringKey, $this->items) || !true) {
continue;
}
$this->items[$stringKey] = $data;
|
Run mutation tests with infection/infection:
src/Loader/Data/Client.php#L99
Escaped Mutant for Mutator "LogicalOr":
@@ @@
assert(is_array($fileData));
foreach ($fileData as $key => $data) {
$stringKey = (string) $key;
- if (array_key_exists($stringKey, $this->items) || !$data instanceof DataClient) {
+ if (array_key_exists($stringKey, $this->items) && !$data instanceof DataClient) {
continue;
}
$this->items[$stringKey] = $data;
|
Loading