Skip to content

PHPdoc of setUseConfigMinSaleQty method uses int instead of bool #36812

Open
@hostep

Description

@hostep

Preconditions and environment

  • Magento 2.4.5-p1 or 2.4-develop (and probably all older versions)

Steps to reproduce

  1. Look at
    /**
    * @param int $useConfigMinSaleQty
    * @return $this
    */
    public function setUseConfigMinSaleQty($useConfigMinSaleQty);
  2. Also look at
    /**
    * @param int $useConfigMinSaleQty
    * @return $this
    */
    public function setUseConfigMinSaleQty($useConfigMinSaleQty)
    {
    return $this->setData(self::USE_CONFIG_MIN_SALE_QTY, $useConfigMinSaleQty);
    }

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”.

Metadata

Metadata

Assignees

Labels

Area: FrameworkComponent: CodeIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.4.5-p1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions