Skip to content

Wrong return type in PHPDoc of fetchOne() method in  #34598

Open
@TomashKhamlai

Description

@TomashKhamlai

Preconditions (*)

  1. You have access to Magento code from IDE (PhpStorm, VSCode, NetBeans)
  2. This line can be opened in the IDE on latest 2.4-develop

Steps to reproduce (*)

  1. Use fetchOne() to get row from sales_order in your custom code and trust Magento framework that it returns string
  2. Substitute an email that is not in sales_order table to $sql

Expected result (*)

  1. PHPDoc information looks like this
    /**
     * Fetches the first column of the first row of the SQL result.
     *
     * @param string|\Magento\Framework\DB\Select $sql An SQL SELECT statement.
     * @param mixed $bind Data to bind into SELECT placeholders.
     * @return string|bool
     */
    public function fetchOne($sql, $bind = []);

Actual result (*)

  1. It returns string or bool
    /**
     * Fetches the first column of the first row of the SQL result.
     *
     * @param string|\Magento\Framework\DB\Select $sql An SQL SELECT statement.
     * @param mixed $bind Data to bind into SELECT placeholders.
     * @return string
     */
    public function fetchOne($sql, $bind = []);

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • 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: FrameworkIssue: 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.xIndicates 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