Skip to content

Commit

Permalink
Merge pull request #49 from simPod/php7.4
Browse files Browse the repository at this point in the history
Require PHP 7.4
  • Loading branch information
simPod authored Aug 12, 2020
2 parents a4caec9 + 9ebee9f commit 9d064cb
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 77 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
php: [7.3, 7.4]
php: [7.4]
env: [
'DEPENDENCIES=--prefer-lowest',
'',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/infection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<rule ref="Cdn77">
<exclude name="SlevomatCodingStandard.Files.LineLength"/>
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
</rule>

<rule ref="SlevomatCodingStandard.Files.LineLength">
Expand Down
9 changes: 3 additions & 6 deletions src/Client/Http/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions src/Client/Http/RequestOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

final class RequestOptions
{
/** @var string */
public $sql;
public string $sql;

/** @var array<string, float|int|string> */
public $parameters;
public array $parameters;

/**
* @param array<string, float|int|string> $defaultParameters
Expand Down
17 changes: 6 additions & 11 deletions src/Client/PsrClickHouseAsyncClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, float|int|string> */
private $defaultParameters;
private array $defaultParameters;

/** @var SqlFactory */
private $sqlFactory;
private SqlFactory $sqlFactory;

/** @param array<string, float|int|string> $defaultParameters */
public function __construct(
Expand Down
20 changes: 7 additions & 13 deletions src/Client/PsrClickHouseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, float|int|string> */
private $defaultParameters;
private array $defaultParameters;

/** @var ValueFormatter */
private $valueFormatter;
private ValueFormatter $valueFormatter;

/** @var SqlFactory */
private $sqlFactory;
private SqlFactory $sqlFactory;

/** @param array<string, float|int|string> $defaultParameters */
public function __construct(
Expand Down
12 changes: 5 additions & 7 deletions src/Output/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
final class Json implements Output
{
/** @var array<array<string, mixed>> */
public $data;
public array $data;

/** @var array<mixed> */
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)
{
Expand Down
12 changes: 5 additions & 7 deletions src/Output/JsonCompact.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
final class JsonCompact implements Output
{
/** @var array<array<mixed>> */
public $data;
public array $data;

/** @var array<mixed> */
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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Output/JsonEachRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
final class JsonEachRow implements Output
{
/** @var array<array<string, mixed>> */
public $data;
public array $data;

public function __construct(string $contentsJson)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Output/TabSeparated.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/** @psalm-immutable */
final class TabSeparated implements Output
{
/** @var string */
public $contents;
public string $contents;

public function __construct(string $contents)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

final class Expression
{
/** @var string */
public $innerExpression;
public string $innerExpression;

private function __construct(string $expression)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/ExpressionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

final class ExpressionFactory
{
/** @var ValueFormatter */
private $valueFormatter;
private ValueFormatter $valueFormatter;

public function __construct(ValueFormatter $valueFormatter)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/SqlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
/** @internal */
final class SqlFactory
{
/** @var ValueFormatter */
private $valueFormatter;
private ValueFormatter $valueFormatter;

public function __construct(ValueFormatter $valueFormatter)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Sql/ValueFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
/** @internal */
final class ValueFormatter
{
/** @var DateTimeZone|null */
private $dateTimeZone;
private ?DateTimeZone $dateTimeZone = null;

public function __construct(?DateTimeZone $dateTimeZone = null)
{
Expand Down
17 changes: 5 additions & 12 deletions tests/WithClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d064cb

Please sign in to comment.