braintree_php icon indicating copy to clipboard operation
braintree_php copied to clipboard

Wrong types

Open pupitooo opened this issue 4 years ago • 6 comments

General information

  • SDK/Library version: 6.5.0

Issue description

I try to use v6.5.0 instead of our actual v6.4.1, but PhpStan found a lot of type errors.

  • https://github.com/braintree/braintree_php/commit/e35c2a2d74a10e9cec5932506486e4b8bccfa4ba#diff-5d8643485614b6ed610f9d5e2113102403986e64cbd59a2d2705727b84518c4bR94 - $addressId accepts null
  • https://github.com/braintree/braintree_php/commit/e35c2a2d74a10e9cec5932506486e4b8bccfa4ba#diff-0db98feccc39288c124fa8984ae925913df2972497e619db904b2977d36d1922R22 - $signature accepts and check null also
  • https://github.com/braintree/braintree_php/commit/e35c2a2d74a10e9cec5932506486e4b8bccfa4ba#diff-d7abe012251d6b7ab4f79ba9c5e3ba472063ddeaf5882f62e5e5da776cbd819cR31 - $params is array but expects Optional, what is not defined.
  • https://github.com/braintree/braintree_php/commit/e35c2a2d74a10e9cec5932506486e4b8bccfa4ba#diff-90158b52f755d6c1030ab7527e6a1698dde8165467f7f9c3bdf48d92989abfacR26 - sampleNotification returns not defined Webhook but actually returns array

Commit https://github.com/braintree/braintree_php/commit/e35c2a2d74a10e9cec5932506486e4b8bccfa4ba is full types mistakes like this. Is it possible to fix this?

pupitooo avatar Nov 16 '21 09:11 pupitooo

🙃 well, crud. Sorry about that. If you'd like to PR the fixes to the docs, please feel free to do so! I don't have an ETA on when these will get fixed up, but they will eventually get fixed.

hollabaq86 avatar Nov 17 '21 16:11 hollabaq86

https://github.com/braintree/braintree_php/pull/304

Tlapi avatar Nov 22 '21 13:11 Tlapi

Going to turn this first issue on types into a mega-thread of issues similar issues opened. See also #314

hollabaq86 avatar Apr 26 '22 19:04 hollabaq86

related PRs - #315

hollabaq86 avatar Apr 26 '22 21:04 hollabaq86

for internal tracking, ticket 1401

hollabaq86 avatar Oct 03 '22 19:10 hollabaq86

Lumping in #326 with this as well, in that this PR highlights that returns and throws need cleaning up.

hollabaq86 avatar Jan 20 '23 21:01 hollabaq86