graze / guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle
https://packagist.org/packages/graze/guzzle-jsonrpc
MIT License
93 stars 61 forks source link

Undeclared InvalidArgumentException #40

Open ivashkevitch opened 5 years ago

ivashkevitch commented 5 years ago

src/Message/MessageFactory.php contains 2 methods: fromResponse() and createRequest() that can throws undeclared InvalidArgumentException. Fix it, please.

pawel-slowik commented 4 years ago

The InvalidArgumentException class is a part of the Standard PHP Library.

As of PHP 5.3.0 this extension can no longer be disabled and is therefore always available.

The minimum supported PHP version for guzzle-jsonrpc is 5.5:

https://github.com/graze/guzzle-jsonrpc/blob/2fa76f80cc843008305035ee7d49c0aa58eb7022/composer.json#L33-L34

Therefore, if the InvalidArgumentException class is not declared, you are running guzzle-jsonrpc on an unsupported PHP version.

Therefore, this is not a bug.

biggianteye commented 4 years ago

@ivashkevitch Sorry for not responding sooner. This seems to have fallen through the cracks. It's unclear to me what you asking. Could you clarify?

ivashkevitch commented 4 years ago

biggianteye Hi. I mean these methods didn't have @throws annotations and it is unexpected, when it throws exceptions.