NVision-Commerce-Solutions / module-customer-price

Commerce 365 for Magento - Magento 2 Extension - Customer Price Module
https://n.vision/products/commerce-365-for-magento-b2b/
2 stars 4 forks source link

Possible logic mistake in AdditionalDataPlugin #32

Closed hostep closed 10 months ago

hostep commented 11 months ago

Reported by phpstan on version 1.5.0 of module-customer-price:

------ --------------------------------------------------------------------------------
  Line   module-customer-price/Plugin/Webapi/AdditionalDataPlugin.php
 ------ --------------------------------------------------------------------------------
  27     Variable $additionalData on left side of ?? always exists and is not nullable.
 ------ --------------------------------------------------------------------------------

If we take a look at the execute method, it's currently guaranteed to return an array and never null. So the condition here, will never return $result. Is that the expectation?

hostep commented 10 months ago

This probably got fixed in https://github.com/NVision-Commerce-Solutions/module-customer-price/pull/38, but no new version (1.7.2) got tagged in git yet ....

hostep commented 10 months ago

And 1.7.2 was just released, confirmed that phpstan no longer complains on this. Thanks guys!

soloma88 commented 10 months ago

now it's tagged. you're just too fast :) Thanks