Skip to content

Incompatibility with symfony/type-info > 8.0.4 #3044

@TonySma

Description

@TonySma

Hello,
I'm reaching you, but I'm not sure this is an issue in the Gedmo side.

Since symfony/type-info 8.0.6 (this commit: symfony/type-info@4855cee), they also gather types thanks to @phpstan-template and @psalm-template.

For example in AbstractLogEntry class we can find this UnionType Loggable|object

/**
 * @phpstan-template T of Loggable|object

Which break in type-info UnionType class because we can't create an UnionType with both a class and object
(https://github.com/symfony/symfony/blob/8.1/src/Symfony/Component/TypeInfo/Type/UnionType.php#L74)

if (\in_array(TypeIdentifier::OBJECT, $builtinTypesIdentifiers, true) && \count(array_filter($this->types, fn (Type $t): bool => $t instanceof ObjectType))) {
    throw new InvalidArgumentException('Cannot create union with both "object" and class type.');
}

Thanks you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions