Skip to content

Commit

Permalink
fix: add missing @throws (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod authored May 13, 2024
1 parent 9cd59e7 commit 91a08f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Client/ClickHouseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function selectWithParams(string $query, array $params, Format $outputFor
* @throws ClientExceptionInterface
* @throws ServerError
* @throws UnsupportedParamType
* @throws UnsupportedParamValue
*/
public function insert(string $table, array $values, array|null $columns = null, array $settings = []): void;

Expand Down
5 changes: 4 additions & 1 deletion src/Sql/ExpressionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

namespace SimPod\ClickHouseClient\Sql;

use SimPod\ClickHouseClient\Exception\UnsupportedParamValue;

use function array_map;
use function sprintf;

final class ExpressionFactory
final readonly class ExpressionFactory
{
public function __construct(private ValueFormatter $valueFormatter)
{
}

/** @throws UnsupportedParamValue */
public function templateAndValues(string $template, mixed ...$values): Expression
{
return Expression::new(
Expand Down
10 changes: 8 additions & 2 deletions src/Sql/ValueFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use function sprintf;

/** @internal */
final class ValueFormatter
final readonly class ValueFormatter
{
public function __construct(private DateTimeZone|null $dateTimeZone = null)
{
Expand Down Expand Up @@ -117,6 +117,8 @@ public function format(mixed $value, string|null $paramName = null, string|null
* @param array<mixed> $values
*
* @return array<string>
*
* @throws UnsupportedParamValue
*/
public function mapFormat(array $values): array
{
Expand All @@ -132,7 +134,11 @@ function ($value): string {
);
}

/** @param array<mixed> $value */
/**
* @param array<mixed> $value
*
* @throws UnsupportedParamValue
*/
private function formatArray(array $value): string
{
return sprintf(
Expand Down

0 comments on commit 91a08f8

Please sign in to comment.