Description
Preconditions and environment
- Magento 2.4.5-p1 or 2.4-develop (and probably all older versions)
Steps to reproduce
- Look at
magento2/app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php
Lines 175 to 179 in fc4d9cc
- Also look at
magento2/app/code/Magento/CatalogInventory/Model/Stock/Item.php
Lines 656 to 663 in fc4d9cc
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
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.