Include the correct type into the property of the ContentBehavior #3894
Labels
enhancement
improvements to existing features
site development 👩💻
features related to website/API development
Description
First of all: The way you handle the ContentBehavior is absolutely awesome and I appreciate your idea really much.
I'm not sure if you have ever thought about including a more specific type into the PHPDoc when you create this class? I know this is far away from being a first world problem but including a property like
into
craft\base\Field
that can overwritten by any class that extends it. For example theBaseRelationField
could havewould be really awesome.
You could then fetch the type of the field together with the handle in your query and check if the specific class exists to grab the static attribute
If you think that might make Craft better but don't have the time for it I'm happy to create a pull request.
This way: when we type
$element->user->
PHPStorm (or others) won't complain about missmatches and suggest the functions ofElementQuery
The text was updated successfully, but these errors were encountered: