Annotations Or Attributes?
Hello,
I want to know that is it recommended to use Annotations or Attributes for docs? Which one is better? I've used annotations for years. Is it possible to convert to attributes somehow?
Generally I'd say the way forward is Attributes - it's part of PHP itself, gives you typing and and a lot more flexibility.
Also, annotations are slowly moving towards being deprecated. A lot pf projects have started making annotations optional, for example.
In terms of conversion - have a look here: https://github.com/zircote/swagger-php/issues/1047
The most useful thing about attributes is that IDEs fully support autocompletion with them; you can create docs rules without documentation. With annotations, it was a pain, especially when code highlighting worked incorrectly with annotations :)