Skip to content

fix: complex tuple params with array input #1425

fix: complex tuple params with array input

fix: complex tuple params with array input #1425

Triggered via pull request December 15, 2024 10:55
Status Success
Total duration 44s
Artifacts

infection.yml

on: pull_request
Infection
38s
Infection
Fit to window
Zoom out
Zoom in

Annotations

7 warnings
Infection
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Infection: src/Client/Http/RequestFactory.php#L39
Escaped Mutant for Mutator "Identical": @@ @@ /** @throws InvalidArgumentException */ public function __construct(private ParamValueConverterRegistry $paramValueConverterRegistry, private RequestFactoryInterface $requestFactory, private StreamFactoryInterface $streamFactory, UriFactoryInterface|null $uriFactory = null, UriInterface|string $uri = '') { - if ($uriFactory === null && $uri === '') { + if ($uriFactory !== null && $uri === '') { $uri = null; } elseif (is_string($uri)) { if ($uriFactory === null) {
Infection: src/Client/Http/RequestFactory.php#L105
Escaped Mutant for Mutator "FalseValue": @@ @@ if ($type === null) { continue; } - $streamElements[] = ['name' => 'param_' . $name, 'contents' => $this->paramValueConverterRegistry->get($type)($value, $type, false)]; + $streamElements[] = ['name' => 'param_' . $name, 'contents' => $this->paramValueConverterRegistry->get($type)($value, $type, true)]; } try { $body = new MultipartStream($streamElements);
Infection: src/Client/PsrClickHouseClient.php#L62
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ } public function executeQueryWithParams(string $query, array $params, array $settings = []): void { - $this->executeRequest($this->sqlFactory->createWithParameters($query, $params), params: $params, settings: $settings); + } public function select(string $query, Format $outputFormat, array $settings = []): Output {
Infection: src/Client/PsrClickHouseClient.php#L146
Escaped Mutant for Mutator "Identical": @@ @@ CLICKHOUSE, params: $params, settings: $settings); return; } - if ($columns === null) { + if ($columns !== null) { $firstRow = $values[array_key_first($values)]; $columns = array_keys($firstRow); if (is_int($columns[0])) {
Infection: src/Exception/ServerError.php#L20
Escaped Mutant for Mutator "DecrementInteger": @@ @@ public static function fromResponse(ResponseInterface $response): self { $bodyContent = $response->getBody()->__toString(); - return new self($bodyContent, code: preg_match('~^Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : 0); + return new self($bodyContent, code: preg_match('~^Code: (\d+). DB::Exception:~', $bodyContent, $matches) === 1 ? (int) $matches[1] : -1); } }
Infection: src/Sql/ValueFormatter.php#L103
Escaped Mutant for Mutator "UnwrapArrayMap": @@ @@ $firstValue = $value[array_key_first($value)]; $mapper = is_array($firstValue) ? function ($value): string { assert(is_array($value)); - return sprintf('(%s)', implode(',', array_map(fn($val) => $this->format($val), $value))); + return sprintf('(%s)', implode(',', $value)); } : fn($value): string => $value === null ? 'NULL' : $this->format($value); return implode(',', array_map($mapper, $value)); }