Skip to content

EndpointAbstract.php - Deprecated functionality #248

Description

@homerjsim

I get this error:
2025-07-27T08:19:03+00:00 ERR (3): Deprecated functionality: Optional parameter $from declared before required parameter $filters is implicitly treated as a required parameter in /lib/Mollie/Mollie/src/Endpoints/EndpointAbstract.php on line 144
2025-07-27T08:19:03+00:00 ERR (3): Deprecated functionality: Optional parameter $limit declared before required parameter $filters is implicitly treated as a required parameter in /lib/Mollie/Mollie/src/Endpoints/EndpointAbstract.php on line 0

And I fixed the function with this code. So maybe someone can implement it in a new release

/**
 * Get a collection of objects from the REST API.
 *
 * @param string $from The first resource ID you want to include in your list.
 * @param int $limit
 * @param array $filters
 *
 * @return BaseCollection
 * @throws ApiException
 */
protected function rest_list($from = null, $limit = null, array $filters = [])
{
    $filters = array_merge(["from" => $from, "limit" => $limit], $filters);

    $apiPath = $this->getResourcePath() . $this->buildQueryString($filters);

    $result = $this->client->performHttpCall(self::REST_LIST, $apiPath);

    /** @var BaseCollection $collection */
    $collection = $this->getResourceCollectionObject($result->count, $result->_links);

    foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
        $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->getResourceObject());
    }

    return $collection;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions