Skip to content

Is class_exists supported? #146

@soukicz

Description

@soukicz

I have this code for optional dependency:

if(class_exists('\Composer\CaBundle\CaBundle')) {
   curl_setopt($ch, CURLOPT_CAINFO, \Composer\CaBundle\CaBundle::getBundledCaBundlePath());
}

and phpstan is reporting:

Call to static method getBundledCaBundlePath() on an unknown class Composer\CaBundle\CaBundle.  

Is there problem with my code or is it just edge case that phpstan doesn't recognize?

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