diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 91fcf0c..048925e 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -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,') }} @@ -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,') }} @@ -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 \ No newline at end of file + run: make coverage diff --git a/src/Redis/Response/CursorResponse.php b/src/Redis/Response/CursorResponse.php index 4e024e1..83762fe 100644 --- a/src/Redis/Response/CursorResponse.php +++ b/src/Redis/Response/CursorResponse.php @@ -78,7 +78,7 @@ public function __construct(int $cursorId, int $totalCount, array $items, int $s /** * @return array */ - public function current() + public function current(): mixed { if ($this->doNext) { if (!($this->getClient() instanceof Client)) { @@ -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; @@ -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; } @@ -145,7 +145,7 @@ public function getTotalCount(): int return $this->totalCount; } - public function count() + public function count(): int { return $this->getPageCount(); } diff --git a/src/Redis/Response/PaginatedResponse.php b/src/Redis/Response/PaginatedResponse.php index 0e14dec..39e5056 100644 --- a/src/Redis/Response/PaginatedResponse.php +++ b/src/Redis/Response/PaginatedResponse.php @@ -66,7 +66,7 @@ public function __construct(PaginatedCommand $command, int $totalCount, array $i /** * @return array */ - public function current(): array + public function current(): mixed { if ($this->requestedOffset === ($this->lastCommand->getOffset() ?? 0) && ($this->requestedSize === $this->getPageSize())) { $this->requestedOffset = null; @@ -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;