gocardless / gocardless-pro-php

GoCardless Pro PHP Client
MIT License
97 stars 40 forks source link

Phpstan complains on parameters mismatch #134

Open bochkarev-artem opened 2 years ago

bochkarev-artem commented 2 years ago

After updating phpstan to version 1.7.1 it now gives an error for this usage: Parameter #1 $params of method GoCardlessPro\Services\PaymentsService::create() expects string, array<string, array<string, array<string, string>|int|string>> given.

I see that create method can receive array, string[mixed] $params An associative array for any params. But i guess phpstan sees only string. Will you consider to annotate your method differently?

https://github.com/gocardless/gocardless-pro-php/blob/31116c4a47b7815cbe25e411a1e0382e42006691/lib/Services/PaymentsService.php#L40

noplanman commented 2 years ago

Type hinting in general can definitely be improved in this library.