Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
129 stars 89 forks source link

Fixing php type errors instead of ignoring them #623

Closed mamazu closed 4 years ago

mamazu commented 4 years ago

With the upgrade of phpstan to the newer version some typehints were not fixed but only ignored for simplicity. This pull request fixes them and adds documentation to the right places.

One thing I need to mention though is that most of those can be replaced with real typehints in php like string|int if we can assume that the id's in Sylius are integers (which they are for the most part).

Another thing is that the variable naming of the payment and shipping selector commands is a little confusing. Because the command needs an integer (index) but the identifier could also be a string (payment or shipment-code). This needs to be renamed to clarify. But this would be a BC break, so maybe for a later time.

lchrusciel commented 4 years ago

Thanks, @mamazu! :tada: