woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing type hinting

porchlight opened this issue · comments

Ran into this error when trying to use this on my Drupal 10 site.

Fatal error: Declaration of WoohooLabs\Yang\JsonApi\Response\AbstractResponse::withStatus($code, $reasonPhrase = '') must be compatible with Psr\Http\Message\ResponseInterface::withStatus(int $code, string $reasonPhrase = ''): Psr\Http\Message\ResponseInterface in /var/www/site/vendor/woohoolabs/yang/src/JsonApi/Response/AbstractResponse.php on line 136

The error comes from psr/http-message:^2.0 which Drupal 10 requires.
Looks like we need to add some type hinting to the parameters and return types of some of the methods we are extending from ResponseInterface and MessageInterface

Nevermind! Just needed to update to the 3.0 version. Thanks

Thanks for the report in any case! I'll release v3.0 tomorrow then :)