Skip to content

Commit 5f8617d

Browse files
author
Masiukevich Maksim
committed
types correction
1 parent 4fff187 commit 5f8617d

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
run: composer update --no-ansi --no-interaction --no-progress
101101

102102
- name: Run tests with phpunit
103-
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.xml
103+
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration ./phpunit.xml --debug --coverage-clover=coverage.xml
104104

105105
- name: Send code coverage report to Codecov.io
106106
uses: codecov/codecov-action@v1

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"require-dev": {
5454
"php-service-bus/code-style-config": "v1.3.*",
5555
"phpunit/phpunit": "v9.5.*",
56-
"vimeo/psalm": "v4.3.*",
56+
"vimeo/psalm": "v4.5.*",
5757
"phpstan/phpstan": "v0.12.*",
5858
"amphp/amp": "v2.5.*"
5959
},
@@ -62,10 +62,10 @@
6262
"scripts": {
6363
"psalm": "./vendor/bin/psalm --config=psalm.xml",
6464
"phpstan": "./vendor/bin/phpstan analyse src --level 7",
65-
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose",
66-
"coverage": "./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose",
67-
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
68-
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
65+
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --debug --verbose --debug",
66+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --debug --verbose --debug",
67+
"cs-check": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
68+
"cs-fix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
6969
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 7 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
7070
},
7171
"config": {

src/Sql/AmpPosgreSQL/AmpPostgreSQLAdapter.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
namespace ServiceBus\Storage\Sql\AmpPosgreSQL;
1414

15-
use Amp\Postgres\PgSqlCommandResult;
15+
use Amp\Iterator;
1616
use Amp\Postgres\PooledResultSet;
17-
use Amp\Postgres\PqCommandResult;
18-
use Amp\Sql\ResultSet as AmpResultSet;
17+
use Amp\Sql\CommandResult;
1918
use function Amp\call;
2019
use function Amp\Postgres\pool;
2120
use Amp\Coroutine;
@@ -81,7 +80,7 @@ function () use ($queryString, $parameters) : \Generator
8180
{
8281
$this->logger->debug($queryString, $parameters);
8382

84-
/** @var AmpResultSet|PgSqlCommandResult|PooledResultSet|PqCommandResult $resultSet */
83+
/** @var Iterator|CommandResult|PooledResultSet $resultSet */
8584
$resultSet = yield $this->pool()->execute($queryString, $parameters);
8685

8786
return new AmpPostgreSQLResultSet($resultSet);

src/Sql/AmpPosgreSQL/AmpPostgreSQLResultSet.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212

1313
namespace ServiceBus\Storage\Sql\AmpPosgreSQL;
1414

15+
use Amp\Iterator;
16+
use Amp\Sql\CommandResult;
1517
use function Amp\call;
1618
use Amp\Postgres\PgSqlCommandResult;
1719
use Amp\Postgres\PooledResultSet;
1820
use Amp\Postgres\PqCommandResult;
1921
use Amp\Promise;
20-
use Amp\Sql\ResultSet as AmpResultSet;
2122
use Amp\Success;
2223
use ServiceBus\Storage\Common\Exceptions\ResultSetIterationFailed;
2324
use ServiceBus\Storage\Common\ResultSet;
@@ -28,7 +29,7 @@
2829
class AmpPostgreSQLResultSet implements ResultSet
2930
{
3031
/**
31-
* @var AmpResultSet|PgSqlCommandResult|PooledResultSet|PqCommandResult
32+
* @var Iterator|CommandResult|PooledResultSet
3233
*/
3334
private $originalResultSet;
3435

@@ -38,9 +39,9 @@ class AmpPostgreSQLResultSet implements ResultSet
3839
private $advanceCalled = false;
3940

4041
/**
41-
* @param AmpResultSet|PgSqlCommandResult|PooledResultSet|PqCommandResult $originalResultSet
42+
* @param Iterator|CommandResult|PooledResultSet $originalResultSet
4243
*/
43-
public function __construct(object $originalResultSet)
44+
public function __construct(Iterator|CommandResult|PooledResultSet $originalResultSet)
4445
{
4546
$this->originalResultSet = $originalResultSet;
4647
}
@@ -51,7 +52,7 @@ public function advance(): Promise
5152

5253
try
5354
{
54-
if ($this->originalResultSet instanceof AmpResultSet)
55+
if ($this->originalResultSet instanceof Iterator)
5556
{
5657
return $this->originalResultSet->advance();
5758
}
@@ -70,14 +71,14 @@ public function getCurrent(): ?array
7071
{
7172
try
7273
{
73-
if (
74-
$this->originalResultSet instanceof PgSqlCommandResult ||
75-
$this->originalResultSet instanceof PqCommandResult
76-
) {
74+
if ($this->originalResultSet instanceof CommandResult)
75+
{
7776
return null;
7877
}
7978

80-
/** @var array<string, float|int|resource|string|null>|null $data */
79+
/**
80+
* @var array<string, float|int|resource|string|null>|null $data
81+
*/
8182
$data = $this->originalResultSet->getCurrent();
8283

8384
return $data;

0 commit comments

Comments
 (0)