Skip to content

Wrong annotation in _toOptionArray - magento/framework/Data/Collection/AbstractDb.php #12820

Closed
@BrocksiNet

Description

@BrocksiNet

The annotation for valueField should be @param null|string $valueField at the moment php phan thorws this as an error. And i think phan is right.

See here:
src/vendor/magento/framework/Data/Collection/AbstractDb.php

    /**
     * Overridden to use _idFieldName by default.
     *
     * @param null $valueField
     * @param string $labelField
     * @param array $additional
     * @return array
     */
    protected function _toOptionArray($valueField = null, $labelField = 'name', $additional = [])
    {
        if ($valueField === null) {
            $valueField = $this->getIdFieldName();
        }
        return parent::_toOptionArray($valueField, $labelField, $additional);
    }

Metadata

Metadata

Labels

Event: dmcdindiaIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions