woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP
MIT License
168 stars 13 forks source link

Empty PSR-7 request object not working anymore #16

Closed Lex85 closed 5 years ago

Lex85 commented 5 years ago

This part of the README is not working anymore

// Instantiate an empty PSR-7 request $request = new Request("", "")

since the PRS-7 request got this update

https://github.com/guzzle/psr7/commit/c5aea30ff82a3565e6d3decd18d74257c033daf6#diff-a788147295d6b475ecb28d093c1ba121

The $method parameter cannot be empty anymore since they introduced this check right in the constructor:

private function assertMethod($method) { if (!is_string($method) || $method === '') { throw new \InvalidArgumentException('Method should be a non empty string.'); } }

kocsismate commented 5 years ago

Thanks for the report! The issue is fixed now. :)