Skip to content

rewrite Headers

rewrite Headers #3124

Triggered via pull request January 18, 2025 12:03
@mimmi20mimmi20
synchronize #872
updates
Status Failure
Total duration 29m 42s
Artifacts

continuous-integration.yml

on: pull_request
Matrix: Validate Project / Check composer dependencies with composer-dependency-analyser
Matrix: Validate Project / Check composer with composer-normalize
Matrix: Validate Project / Check with editorconfig-checker
Matrix: Validate Project / Lint PHP
Matrix: Validate Project / Validate markdown files
Matrix: Validate Project / Linting with overtrue/phplint
Matrix: Validate Project / Validate composer
Matrix: Validate Project / Validate yaml
Validate Project  /  Lint & Validate Status
0s
Validate Project / Lint & Validate Status
Matrix: Install Project / Install Node dependencies
Matrix: Install Project / Install PHP dependencies
Install Project  /  Install Status
0s
Install Project / Install Status
Matrix: Project Analysis / Run eslint
Matrix: Project Analysis / Check Coding Standards with PHP-CS-Fixer
Matrix: Project Analysis / Check Coding Standards with PHPCS
Matrix: Project Analysis / Run prettier
Matrix: Project Analysis / Checks with Rector
Matrix: Project Analysis / Static Code Analysis with PHPStan
Matrix: Project Analysis / Run stylelint
Project Analysis  /  Status Analytics
0s
Project Analysis / Status Analytics
Matrix: UnitTests / Code Coverage with PHPUnit
Matrix: UnitTests / UnitTests with PHPUnit
Matrix: UnitTests / UnitTests with stryker
Matrix: UnitTests / UnitTests with vitest
Matrix: Integration Tests with PHPUnit
UnitTests  /  finish-code-coverage
0s
UnitTests / finish-code-coverage
UnitTests  /  Unit & Integration Tests Status
0s
UnitTests / Unit & Integration Tests Status
Unit & Integration Tests Status
0s
Unit & Integration Tests Status
Fit to window
Zoom out
Zoom in

Annotations

4 errors and 10 warnings
Integration Tests with PHPUnit (ubuntu-24.04, 8.3, lowest)
Process completed with exit code 1.
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest)
Process completed with exit code 1.
UnitTests / Unit & Integration Tests Status
Process completed with exit code 1.
Unit & Integration Tests Status
Process completed with exit code 1.
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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;
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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());
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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());
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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) {
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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) {
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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, []);
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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; }
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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;
UnitTests / Code Coverage with PHPUnit (ubuntu-24.04, 8.3, lowest): 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;