Skip to content

ClassMetadata template should not be template-covariant since PHP 8.4 #474

@VincentLanglet

Description

@VincentLanglet

Bug Report

Q A
Version all since 2.1

Summary

In php 8.4+ ReflectionClass lost his template-covariant annotation because of proxy methods,
see phpstan/phpstan-src@25ec5eb

This means that an interface which has a method returning ReflectionClass<T> cannot be use a covariant template too.

Expected behavior

I assume doctrine should

Related issue on phpstan-doctrine
phpstan/phpstan-doctrine#646
and PR phpstan/phpstan-doctrine#663
(Maybe ondrej will have a better answer/solution ?)

How to reproduce

I assume the error will happen on the doctrine codebase as soon as you will target a PHP version higher or equal to 8.4,
but currently you're on 8.1 for phpstan

phpVersion: 80100

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