Skip to content

Add support for attribute array shape #1681

Open
@Khartir

Description

@Khartir

Summary

If an attribute has an array type that has a defined shape, the generation of the docblock breaks. It would be nice, if this was supported.

Example:

    /**
     * @param array{longitude: float|null, latitude: float|null} $coordinates
     */
    public function setCenterAttribute(array $coordinates): void
    {}

    /**
     * @return array{longitude: float|null, latitude: float|null}
     */
    public function getCenterAttribute(): array
    {}

generates the following docblock:

/**
 * @property \App\Models\array{longitude: $center
 * @mixin \Eloquent
 */

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions