Skip to content

in_array with possible missing values throws "will always evaluate to true" in strict mode #3892

@faizanakram99

Description

@faizanakram99

Bug report

This code snip will not always be true as OrderSaved::$dtos might not contain ReceiptOrder since ReceiptOrder::fromOrder() can return null

if (\in_array(ReceiptOrder::class, $missingClasses, true)) {
}

Code snippet that reproduces the problem

https://phpstan.org/r/7b6a301e-f874-4dce-bcd5-1c54cd42e854

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions