Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Client/PsrClickHouseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function select(
): Output {
try {
return $this->selectWithParams($query, params: [], outputFormat: $outputFormat, settings: $settings);
} catch (UnsupportedParamValue | UnsupportedParamType) {
} catch (UnsupportedParamType | UnsupportedParamValue) {
absurd();
}
}
Expand Down Expand Up @@ -124,7 +124,7 @@ public function selectStream(
): StreamInterface {
try {
return $this->selectStreamWithParams($query, params: [], outputFormat: $outputFormat, settings: $settings);
} catch (UnsupportedParamValue | UnsupportedParamType) {
} catch (UnsupportedParamType | UnsupportedParamValue) {
absurd();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Output/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function testContentsAreSet(): void
1

TEXT;
self::assertSame($contents, (new Basic($contents))->contents);
self::assertSame($contents, new Basic($contents)->contents);
}
}
2 changes: 1 addition & 1 deletion tests/Sql/SqlFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class SqlFactoryTest extends TestCaseBase
#[DataProvider('providerCreateWithParameters')]
public function testCreateWithParameters(string $expectedSql, string $sqlWithPlaceholders, array $parameters): void
{
$sql = (new SqlFactory(new ValueFormatter()))->createWithParameters($sqlWithPlaceholders, $parameters);
$sql = new SqlFactory(new ValueFormatter())->createWithParameters($sqlWithPlaceholders, $parameters);

self::assertSame($expectedSql, $sql);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Sql/ValueFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testFormat(
): void {
self::assertSame(
$expectedValue,
(new ValueFormatter())->format($value, $paramName, $sql),
new ValueFormatter()->format($value, $paramName, $sql),
);
}

Expand Down Expand Up @@ -117,7 +117,7 @@ public function __toString(): string
#[DataProvider('providerMapFormat')]
public function testMapFormat(array $expectedValues, array $values): void
{
self::assertSame($expectedValues, (new ValueFormatter())->mapFormat($values));
self::assertSame($expectedValues, new ValueFormatter()->mapFormat($values));
}

/** @return iterable<string, array<array<mixed>>> */
Expand All @@ -130,13 +130,13 @@ public function testUnsupportedTypeThrows(): void
{
$this->expectException(UnsupportedParamValue::class);

(new ValueFormatter())->format(new stdClass());
new ValueFormatter()->format(new stdClass());
}

public function testUnsupportedValueThrows(): void
{
$this->expectException(UnsupportedParamValue::class);

(new ValueFormatter())->format([], 'list', 'SELECT * FROM table WHERE a IN (:list)');
new ValueFormatter()->format([], 'list', 'SELECT * FROM table WHERE a IN (:list)');
}
}
Loading