diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 30d609a..268df0f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@2.4.2
with:
- php-version: 7.3
+ php-version: 7.4
coverage: none
extensions: json
tools: cs2pr
@@ -51,7 +51,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@2.4.2
with:
- php-version: 7.3
+ php-version: 7.4
coverage: none
extensions: json
tools: cs2pr
@@ -90,7 +90,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@2.4.2
with:
- php-version: 7.3
+ php-version: 7.4
coverage: pcov
extensions: json
@@ -122,7 +122,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
- php: [7.3, 7.4]
+ php: [7.4]
env: [
'DEPENDENCIES=--prefer-lowest',
'',
diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml
index 5d9951b..ad19f8a 100644
--- a/.github/workflows/infection.yml
+++ b/.github/workflows/infection.yml
@@ -23,7 +23,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@2.4.2
with:
- php-version: 7.3
+ php-version: 7.4
coverage: xdebug
extensions: json
diff --git a/composer.json b/composer.json
index fd9112b..47b10b3 100644
--- a/composer.json
+++ b/composer.json
@@ -21,7 +21,7 @@
"sort-packages": true
},
"require": {
- "php-64bit": "^7.3",
+ "php-64bit": "^7.4",
"guzzlehttp/promises": "^1.3",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index c3adc0d..c8ad423 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -14,7 +14,6 @@
-
diff --git a/src/Client/Http/RequestFactory.php b/src/Client/Http/RequestFactory.php
index 44c6cfa..69c2e70 100644
--- a/src/Client/Http/RequestFactory.php
+++ b/src/Client/Http/RequestFactory.php
@@ -15,14 +15,11 @@
final class RequestFactory
{
- /** @var RequestFactoryInterface */
- private $requestFactory;
+ private RequestFactoryInterface $requestFactory;
- /** @var UriFactoryInterface */
- private $uriFactory;
+ private UriFactoryInterface $uriFactory;
- /** @var StreamFactoryInterface */
- private $streamFactory;
+ private StreamFactoryInterface $streamFactory;
public function __construct(
RequestFactoryInterface $requestFactory,
diff --git a/src/Client/Http/RequestOptions.php b/src/Client/Http/RequestOptions.php
index e01d9b7..d75dcf5 100644
--- a/src/Client/Http/RequestOptions.php
+++ b/src/Client/Http/RequestOptions.php
@@ -6,11 +6,10 @@
final class RequestOptions
{
- /** @var string */
- public $sql;
+ public string $sql;
/** @var array */
- public $parameters;
+ public array $parameters;
/**
* @param array $defaultParameters
diff --git a/src/Client/PsrClickHouseAsyncClient.php b/src/Client/PsrClickHouseAsyncClient.php
index 867b356..3302890 100644
--- a/src/Client/PsrClickHouseAsyncClient.php
+++ b/src/Client/PsrClickHouseAsyncClient.php
@@ -21,23 +21,18 @@
class PsrClickHouseAsyncClient implements ClickHouseAsyncClient
{
- /** @var HttpAsyncClient */
- private $asyncClient;
+ private HttpAsyncClient $asyncClient;
- /** @var RequestFactory */
- private $requestFactory;
+ private RequestFactory $requestFactory;
- /** @var LoggerInterface */
- private $logger;
+ private LoggerInterface $logger;
- /** @var string */
- private $endpoint;
+ private string $endpoint;
/** @var array */
- private $defaultParameters;
+ private array $defaultParameters;
- /** @var SqlFactory */
- private $sqlFactory;
+ private SqlFactory $sqlFactory;
/** @param array $defaultParameters */
public function __construct(
diff --git a/src/Client/PsrClickHouseClient.php b/src/Client/PsrClickHouseClient.php
index c471a29..8520aa8 100644
--- a/src/Client/PsrClickHouseClient.php
+++ b/src/Client/PsrClickHouseClient.php
@@ -27,26 +27,20 @@
class PsrClickHouseClient implements ClickHouseClient
{
- /** @var ClientInterface */
- private $client;
+ private ClientInterface $client;
- /** @var RequestFactory */
- private $requestFactory;
+ private RequestFactory $requestFactory;
- /** @var LoggerInterface */
- private $logger;
+ private LoggerInterface $logger;
- /** @var string */
- private $endpoint;
+ private string $endpoint;
/** @var array */
- private $defaultParameters;
+ private array $defaultParameters;
- /** @var ValueFormatter */
- private $valueFormatter;
+ private ValueFormatter $valueFormatter;
- /** @var SqlFactory */
- private $sqlFactory;
+ private SqlFactory $sqlFactory;
/** @param array $defaultParameters */
public function __construct(
diff --git a/src/Output/Json.php b/src/Output/Json.php
index 45b0a0d..54fdcd9 100644
--- a/src/Output/Json.php
+++ b/src/Output/Json.php
@@ -10,19 +10,17 @@
final class Json implements Output
{
/** @var array> */
- public $data;
+ public array $data;
/** @var array */
- public $meta;
+ public array $meta;
- /** @var int */
- public $rows;
+ public int $rows;
- /** @var int|null */
- public $rowsBeforeLimitAtLeast;
+ public ?int $rowsBeforeLimitAtLeast = null;
/** @var array{elapsed: float, rows_read: int, bytes_read: int} */
- public $statistics;
+ public array $statistics;
public function __construct(string $contentsJson)
{
diff --git a/src/Output/JsonCompact.php b/src/Output/JsonCompact.php
index 2c517c5..68f5e03 100644
--- a/src/Output/JsonCompact.php
+++ b/src/Output/JsonCompact.php
@@ -10,19 +10,17 @@
final class JsonCompact implements Output
{
/** @var array> */
- public $data;
+ public array $data;
/** @var array */
- public $meta;
+ public array $meta;
- /** @var int */
- public $rows;
+ public int $rows;
- /** @var int|null */
- public $rowsBeforeLimitAtLeast;
+ public ?int $rowsBeforeLimitAtLeast = null;
/** @var array{elapsed: float, rows_read: int, bytes_read: int} */
- public $statistics;
+ public array $statistics;
public function __construct(string $contentsJson)
{
diff --git a/src/Output/JsonEachRow.php b/src/Output/JsonEachRow.php
index 8d66ef1..d9e7097 100644
--- a/src/Output/JsonEachRow.php
+++ b/src/Output/JsonEachRow.php
@@ -12,7 +12,7 @@
final class JsonEachRow implements Output
{
/** @var array> */
- public $data;
+ public array $data;
public function __construct(string $contentsJson)
{
diff --git a/src/Output/TabSeparated.php b/src/Output/TabSeparated.php
index ec74019..58b5c85 100644
--- a/src/Output/TabSeparated.php
+++ b/src/Output/TabSeparated.php
@@ -7,8 +7,7 @@
/** @psalm-immutable */
final class TabSeparated implements Output
{
- /** @var string */
- public $contents;
+ public string $contents;
public function __construct(string $contents)
{
diff --git a/src/Sql/Expression.php b/src/Sql/Expression.php
index ccb3429..756f173 100644
--- a/src/Sql/Expression.php
+++ b/src/Sql/Expression.php
@@ -6,8 +6,7 @@
final class Expression
{
- /** @var string */
- public $innerExpression;
+ public string $innerExpression;
private function __construct(string $expression)
{
diff --git a/src/Sql/ExpressionFactory.php b/src/Sql/ExpressionFactory.php
index 7251640..3f656f6 100644
--- a/src/Sql/ExpressionFactory.php
+++ b/src/Sql/ExpressionFactory.php
@@ -9,8 +9,7 @@
final class ExpressionFactory
{
- /** @var ValueFormatter */
- private $valueFormatter;
+ private ValueFormatter $valueFormatter;
public function __construct(ValueFormatter $valueFormatter)
{
diff --git a/src/Sql/SqlFactory.php b/src/Sql/SqlFactory.php
index e4a8228..6d03860 100644
--- a/src/Sql/SqlFactory.php
+++ b/src/Sql/SqlFactory.php
@@ -10,8 +10,7 @@
/** @internal */
final class SqlFactory
{
- /** @var ValueFormatter */
- private $valueFormatter;
+ private ValueFormatter $valueFormatter;
public function __construct(ValueFormatter $valueFormatter)
{
diff --git a/src/Sql/ValueFormatter.php b/src/Sql/ValueFormatter.php
index 7ca8fca..9180cc9 100644
--- a/src/Sql/ValueFormatter.php
+++ b/src/Sql/ValueFormatter.php
@@ -23,8 +23,7 @@
/** @internal */
final class ValueFormatter
{
- /** @var DateTimeZone|null */
- private $dateTimeZone;
+ private ?DateTimeZone $dateTimeZone = null;
public function __construct(?DateTimeZone $dateTimeZone = null)
{
diff --git a/tests/WithClient.php b/tests/WithClient.php
index 2b654ed..094ea06 100644
--- a/tests/WithClient.php
+++ b/tests/WithClient.php
@@ -22,21 +22,14 @@
trait WithClient
{
- /** @var ClickHouseClient */
- private $client;
+ private ClickHouseClient $client;
- /** @var ClickHouseAsyncClient */
- private $asyncClient;
+ private ClickHouseAsyncClient $asyncClient;
- /**
- * @internal
- *
- * @var ClickHouseClient
- */
- private $controllerClient;
+ /** @internal */
+ private ClickHouseClient $controllerClient;
- /** @var string|null */
- private $currentDbName;
+ private ?string $currentDbName = null;
/** @before */
public function setupClickHouseClient() : void