CristalTeam / php-api-wrapper

:rainbow: Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)
MIT License
117 stars 32 forks source link

array_merge() expects at least 1 parameter, 0 given ($this->scopes is null) #53

Open MiloDBD opened 10 months ago

MiloDBD commented 10 months ago

I'm doing a very basic "Transport" (not the basic one) Transport implementation, and I'm seeing $this->scopes is null on a basic GET request...

(src/Builder.php)

public function getQuery()
    {
        return array_merge(
            array_merge(...array_values($this->scopes)),
            $this->query
        );
    }

This got changes here. https://github.com/CristalTeam/php-api-wrapper/blob/4de7a802f3df14155947b94b3fb0c415739b0e30/src/Builder.php#L33C5-L39C6

On this commit https://github.com/CristalTeam/php-api-wrapper/commit/d0afb958f17c4b91109633ec4c432ff6dab07537

If I revert the change to this.

    public function getQuery()
    {
        /*return array_merge(
            array_merge(...array_values($this->scopes)),
            $this->query
        );*/
        return $this->query;
    }

It seems to work.

I could be not implementing this correctly.

Any advice?

Thank you, good work here... appreciated.