Skip to content
Open
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
38 changes: 16 additions & 22 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- #&setup-php
name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v4
with:
php-version: '8.0'
extensions: intl, mbstring
coverage: xdebug
- #&composer-cache
name: Cache Composer packages
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json,') }}
Expand All @@ -27,18 +25,16 @@ jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- #*setup-php
name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v4
with:
php-version: '8.0'
extensions: intl, mbstring
coverage: xdebug
- #*composer-cache
name: Cache Composer packages
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json,') }}
Expand All @@ -51,22 +47,20 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- #*setup-php
name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
- uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v4
with:
php-version: '8.0'
extensions: intl, mbstring
coverage: xdebug
- #*composer-cache
name: Cache Composer packages
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json,') }}
restore-keys: |
${{ runner.os }}-php-
- name: Code coverage
run: make coverage
run: make coverage
8 changes: 4 additions & 4 deletions src/Redis/Response/CursorResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(int $cursorId, int $totalCount, array $items, int $s
/**
* @return array<AggregateResponseItem>
*/
public function current()
public function current(): mixed
{
if ($this->doNext) {
if (!($this->getClient() instanceof Client)) {
Expand Down Expand Up @@ -121,7 +121,7 @@ public function getPageCount(): int
return (int) ceil($this->totalCount / $this->size);
}

public function key()
public function key(): mixed
{
if (0 === $this->size) {
return 0;
Expand All @@ -130,7 +130,7 @@ public function key()
return (int) ceil($this->offset / $this->size) + 1;
}

public function valid()
public function valid(): bool
{
return $this->offset + count($this->items) < $this->totalCount && $this->cursorId > 0;
}
Expand All @@ -145,7 +145,7 @@ public function getTotalCount(): int
return $this->totalCount;
}

public function count()
public function count(): int
{
return $this->getPageCount();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Redis/Response/PaginatedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(PaginatedCommand $command, int $totalCount, array $i
/**
* @return array<ResponseItem>
*/
public function current(): array
public function current(): mixed
{
if ($this->requestedOffset === ($this->lastCommand->getOffset() ?? 0) && ($this->requestedSize === $this->getPageSize())) {
$this->requestedOffset = null;
Expand Down Expand Up @@ -101,7 +101,7 @@ public function getPageCount(): int
return (int) ceil($this->totalCount / $this->getPageSize());
}

public function key(): int
public function key(): mixed
{
if (0 === $this->getPageSize()) {
return 0;
Expand Down