8000 [TypeInfo] Fails to parse types defined in class · Issue #60657 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[TypeInfo] Fails to parse types defined in class #60657
Closed
@aleho

Description

@aleho

Symfony version(s) affected

7.3.0

Description

In 7.3 type info crashes when it encounters a doc block referencing other types.

The types are only for PHPStan or IDE auto completion and shouldn't have any significance to Symfony. The error occurs in a live component that has a service injected with such annotations.

Symfony\Component\TypeInfo\Exception\UnsupportedException
Cannot resolve "list<MyType>".

DomainException
Unhandled "MyType" identifier.

How to reproduce

Have type info parse the doc block of this class:

<?php

/**
 * @phpstan-type MyType array{
 *     key1: string,
 *     key2?: bool,
 * }
 * 
 * @phpstan-type TypesList list<MyType>
 */
readonly class Example
{
}

Possible Solution

No response

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

      0