Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TypeInfo] Reading @var on promoted properties #59959

Closed
@jack-worman

Description

@jack-worman

Symfony version(s) affected

7.2.4

Description

The@var tag is no longer read for promoted properties.

The bug was introduced in#59681

The example in the documentation no longer works:https://symfony.com/doc/current/components/type_info.html#phpdoc-parsing

How to reproduce

class Dummy{publicfunction__construct(/** @var list<string> $tags */publicarray$tags,    ) {    }}$typeResolver = TypeResolver::create();var_export($typeResolver->resolve(new \ReflectionProperty(Dummy::class,'tags')));// only "array" instead of "list<string>"

Possible Solution

The correct solution is to prioritize the@var annotation on the property and then fallback to the@param annotation on the constructor

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp