is there a way to use any class as property type in @property ?
Is there a way to 'cheat' in phpstorms autocomplete to force it to see non-standard PHP types as magic properties?
for example:
/**
* @property $title string
* @property $content string
* @property $postdate DateTime
**/
class Article {
...
...
}
somewhere outside the class I want to do the following and get PHPStorm to recognise postdate as a DateTime object for auto-complete:
$a = new Article();
$a->postdate->
is this possible somehow? It is important that the property must remain magic and not public (since I can't intercept setting a public property for validation).
Please sign in to leave a comment.
Hi there,
Yes.
Yes.
Start with reading documentation about *correct syntax*.
Thanks! Can't believe I didn't notice I had them in the wrong order :)