Skip to content

Add support for class_exist check to avoid phpstan errors #3169

@alexander-schranz

Description

@alexander-schranz

Bug report

Currently if you have a class_exists around something phpstan will still throw an error.

Code snippet that reproduces the problem

https://phpstan.org/r/92454f28-a02b-48b6-8b63-ec17656a57cb

if (class_exists(NOT_EXIT_CLASS::class)) {
    $bundles = new NOT_EXIT_CLASS();
}

Expected output

PHPStan should not error.

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