Agile UI: PhpStorm not detecting all phpDoc blocks

Hi,

I’m using Agile UI 1.7.1 and I’m very new to it (just installed it).

This caught into my eye while looking at the \atk\ui\App class in PhpStorm 2019.2:

See, the phpdoc block above the public variable $layout is not recognised as phpdoc syntax (the @var tag is not bold and not underlined). Then take a look at the phpdoc block above the public variable $catch_exceptions. The @var tag in this block is bold and underlined.

The difference is that the former @var tag is placed in a simple php comment (starts with //) and the working one is placed in a standard phpdoc comment (/** */).

I tried to look at PhpStorm settings and Google around to find out if I could make PhpStorm to recognise also the non-standard way to write phpdoc blocks, but I was out of luck, so that’s why I’m here asking for a solution.

The issue is that now that PhpStorm doesn’t recognize all the phpdoc blocks, for example the $layout property is interpreted to be just simply the type of null, so I can’t use autocomplete in PhpStorm, at least not everywhere.

Do you think that this is something that I should fix in my editor settings or should the codebase of Agile UI (maybe other components too?) be refactored so that all the non-standard // phpdoc blocks would be refactored to /** */?

Thank you for your support!

Hi @jarkko.

If you have some time and you’d fix in the source file (app) and in other files, this would be a great contribution from you.

We are busy with the 2.0 version planning. I’ve tried to look around for a contributor guide, but couldn’t find anything relevant, so we probably need to look into that too. Here is a few steps for you:

  • Check if the variable format is recognized by phpstorm. Perhaps it only fails to highlight @var?
  • If the tag is ignored, find a way how to turn on parsing of // comments.
  • If that’s not possible, you might need to modify ATK UI sources. This would take some of your time, if you are ready then:
  • Find out how to use develop branch for atk4/ui. Also find Gitter.im chat where you can find other members of community who would be able to help
  • Learn how to fork atk4 repositories and create pull requests
  • Start with a small contribution, perhaps just a single file. Set correct tags in git.
  • If your PR is accepted and merged, you can then continue with other files.

The experience will be very helpful to you, you’ll get confidence and in the future you can also mention being open-source contributor on your resume or help other projects. I hope you find this helpful.

Thansk, I will modify ATK UI sources and create a PR. If I’m not mistaken, there are only two files having this issue, so I think I will go and modify them in a single PR.

I’ve created an issue for this in GitHub: https://github.com/atk4/ui/issues/823

I used a lot of time to investigate if PhpStorm could be configured to interpret // comments as phpdoc comments, but with no luck, so I’m quite sure it is not possible.