magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

PHPdoc of setUseConfigMinSaleQty method uses int instead of bool #36812

Open hostep opened 1 year ago

hostep commented 1 year ago

Preconditions and environment

Steps to reproduce

  1. Look at https://github.com/magento/magento2/blob/fc4d9cc9673dc1ae123fca5db96a64947b49c567/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php#L175-L179
  2. Also look at https://github.com/magento/magento2/blob/fc4d9cc9673dc1ae123fca5db96a64947b49c567/app/code/Magento/CatalogInventory/Model/Stock/Item.php#L656-L663

Expected result

* @param bool $useConfigMinSaleQty

This documentation is incorrect, this flag should be a boolean and not an integer

Actual result

You'll see:

* @param int $useConfigMinSaleQty

Additional information

When running a static analyser like phpstan on our custom code that tries to set this flag with a boolean value, we get a warning that we should provide an integer. But that's not correct in my opinion. This is a flag and not an integer value that's expected. So the documentation should be updated here.

All othersetUseConfig* methods in those classes are defined with a boolean, just the setUseConfigMinSaleQty is incorrectly defined.

Release note

Fixes phpdoc block for the StockItemInterface::setUseConfigMinSaleQty method, from expecting an integer to expecting a boolean value.

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @hostep. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] commented 1 year ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 1 year ago

Hi @hostep , Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Hence confirming the issue. All othersetUseConfig methods in the class are defined as boolean, onlysetUseConfigMinSaleQty is incorrectly defined.

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-7908 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 year ago

:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.