Skip to content

TypeError Recurly\BaseClient::nextPage(): Return value must be of type Recurly\Page, Recurly\EmptyResourcereturned #787

Description

@crystinutzaa

Describe the bug

We get an error in our production related to a Type Error due to nextPage() which returns an EmptyResource instead of Recurly/Page resource. This error started to appear suddenly since 2024-01-02 12:58:40 pm GMT+2

To Reproduce

In our production implementation we started to receive the error with this complete stack trace:

TypeError Recurly\BaseClient::nextPage(): Return value must be of type Recurly\Page, Recurly\EmptyResource returned
(Most recent call first)
2 non-project frames
at
(unknown method)(/var/www/vendor/recurly/recurly-client/lib/recurly/base_client.php:143)
Recurly\BaseClient::nextPage(/var/www/vendor/recurly/recurly-client/lib/recurly/pager.php:89)
at
Recurly\Pager::rewind(/var/www/models/classes/Invoices.php:25)

In our implementation we have $invoices = $this->_client->listAccountInvoices('code-' . $account_code);

Expected behavior

Either allow to return Recurly\EmptyResource or return an empty Recurly\Page and address the type error.

Your Environment

  • Which version of this library are you using? : "recurly/recurly-client": "^4.27",
  • "php": ">=8.1",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions