Skip to content

v2.x PHPStan extension is incompatible with PHPStan 2 #3124

@mortenscheel

Description

@mortenscheel

Hello,

Carbon v2.x is incompatible with PHPStan v2 when using macros.
When encountering a Carbon macro, PHPStan crashes with

Internal error: Class "PHPStan\Reflection\Php\BuiltinMethodReflection" does not exist while analysing file /path/to/file.php

Specifically it's crashing on this line:

$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getReflection');

Is it possible to backport the updated extension from v3.x?

Carbon version: 2.72.5

PHP version: 8.3.14

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions