Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for attribute array shape #1681

Open
Khartir opened this issue Feb 19, 2025 · 0 comments
Open

Add support for attribute array shape #1681

Khartir opened this issue Feb 19, 2025 · 0 comments

Comments

@Khartir
Copy link

Khartir commented Feb 19, 2025

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
 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant