Skip to content

add PHPDoc hints for IDE property support in traits #457

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mitoop
Copy link

@mitoop mitoop commented Jun 12, 2025

This PR adds a PHPDoc annotation for the $translatedAttributes property to improve IDE support and developer experience when working with translatable models. It helps make the expected structure and usage of this property clearer during development.

@mitoop
Copy link
Author

mitoop commented Jun 14, 2025

@Gummibeer Could you have a review?

@@ -16,6 +16,7 @@
* @property-read string $translationForeignKey
* @property-read string $localeKey
* @property-read bool $useTranslationFallback
* @property array $translatedAttributes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be one of these then?

Suggested change
* @property array $translatedAttributes
* @property string[] $translatedAttributes

or

Suggested change
* @property array $translatedAttributes
* @property array<array-key, string> $translatedAttributes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chose this one

 * @property string[] $translatedAttributes

Signed-off-by: mitoop <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants