Skip to content

How to define a more complex accessor return type? #1630

Open
@joelstein

Description

@joelstein

Versions:

  • ide-helper Version: 3.2.2
  • Laravel Version: 11.35.1
  • PHP Version: 8.3.14

Question:

Suppose I have a model with an accessor attribute that returns an array of ints:

protected function minutes(): Attribute
{
return Attribute::make(
get: fn (): array => [0, 15, 30, 45],
);
}
This will produce @property-read array $minutes.

How can I help this package produce something like @property-read array<int> $minutes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions