-
Notifications
You must be signed in to change notification settings - Fork 111
phpDoc: Some @var tags not interpreted by PhpStorm #823
Description
Hi everyone,
I'm pretty new to ATK and just getting started to know this framework and contributing to it. One issue that I've had is that my IDE (PhpStorm 2019.2) does not recognise phpdoc if it's written in a non-standard way:
class App
{
// ...
// @var string Version of Agile UI --- A non-standard way to express phpdoc, not recognised by PhpStorm
public $version = '1.7.1';
// ...
/** --- A standard way to express phpdoc, does work in PhpStorm
* Set one or more directories where templates should reside.
*
* @var string|array
*/
public $template_dir = null;
/** @var string|array Description. --- Also a single line style works */
public $another_example = null;
// ...
}So if phpdoc comments are written with // instead of /** */, PhpStorm will not interpret the comments, which will weaken the power of the IDE's autocomplete feature, which I use all the time.
I asked about this issue in the forums and I was advised to create a pull request to deal with this issue. I was suggested to start by first fixing one file and creating a pull request and once that's merged, then edit more files and create a new pull request. However, a very quick search in the ATK UI codebase seems to indicate that this issue only occurs in two files: vendor/atk4/ui/src/App.php and vendor/atk4/ui/src/FormLayout/Custom.php, so I think I will just go with one PR fixing everything.
I'm creating this issue so that I can refer to it in my commit(s) and so that if needed, I can refer to the same issue again in possible further pull requsts, if I happen to miss some non-standard phpdoc comments in the first PR.