Skip to content

Incorrect deprecation notice #489

@craigh

Description

@craigh

Bug Report

Q A
Version 2.4.0
Previous Version if the bug is a regression 2.3.0 (probably)

Summary

Valid code is triggering a deprecation notice.

Current behavior

This code is triggering this notice.

Passing null as $firstResult to the constructor of Doctrine\Common\Collections\Criteria is deprecated. Pass 0 instead or omit the argument. (Criteria.php:85 called by Seat.php:530, https://github.com/doctrine/collections/pull/311, package doctrine/collections)

with this code:

new Criteria(orderings: ['startDate' => Order::Descending], accessRawFieldValues: true)

I think the counting of the function args isn't working as expected

        if ($firstResult === null && func_num_args() > 2) {

Expected behavior

This code should not be triggering this notice.

How to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions