Skip to content

Support iterable type for HasMany #1802

@brendt

Description

@brendt

Just a scratch:

interface HasIterableType
{
    public TypeReflector $iterableType { get; }
}

class HasMany implements HasIterableType {}

public function getIterableType(): ?TypeReflector
{
    if ($this->hasAttribute(HasIterableType::class)) {
        return $this->getAttribute(HasIterableType::class)->iterableType;
    }

    // Fallback to docblock parsing
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions