Closed nhatzbulawan closed 2 years ago
I think you are confusing the DocBlock @var with using var as a property as in PHP 4. This library does not use standard PHP properties, but get and set to control access to the object and do some validation that standard PHP properties don't support. It does document everything with @var as per the DocBlock conventions.
Because of that, autocomplete may not work unless your IDE supports autocomplete from DocBlocks.
Hello,
Thank you for your response. You are correct, I am referring to the DocBlock @var. I am currently using PHPStorm with the latest version.
However, I would suggest using @property for the magic properties of any classes. https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/property.html https://pear.php.net/package/PhpDocumentor/docs/latest/phpDocumentor/tutorial_tags.property.pkg.html
I am not sure about other editors but I think they use @var for declared properties. https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/var.html
I will close this ticket since it does not affect any functionalities just the auto-complete.
Thanks for the info. There should be a new version out there tomorrow with the @property instead of @var if my cron job runs correctly.
Autocomplete due to issue with PSR-12.
The var keyword MUST NOT be used to declare a property.
For more info: https://www.php-fig.org/psr/psr-12/#43-properties-and-constants