phpsa icon indicating copy to clipboard operation
phpsa copied to clipboard

[Analyzer] DocBlocks

Open ddmler opened this issue 9 years ago • 2 comments

A collection of things we need to do to fully support docblocks First we need to get missing docblock for properties working: https://github.com/ovr/phpsa/blob/master/src/Compiler/Expression.php#L263

ddmler avatar Sep 06 '16 13:09 ddmler

Yes I was trying to support it, but it's not easy as I see

Docblocks is based on NS and needed to create NS context to pass it intro phpdocument annotations analyzer, review composer.json package to find this extra component

Will be rly cool to have this, will help with protecting and understanding what is the variable type

Seems PHP annotations is needed for:

  • Properties
  • ClassConstants
  • Methods
  • Classes
  • Traits
  • Interfaces
  • Functions

And @ as

  • @return
  • @param
  • @throws
  • @method
  • @deprecated
  • @internal

And there are advanced annotations, for example Doctrine, Swagger-PHP or PHPUnit as an example

ovr avatar Sep 06 '16 13:09 ovr

  • [ ] [Analyzer] issue a warning when using something which is annotated with @deprecated
  • [ ] [Analyzer] display all found @todo comments
  • [ ] [Analyzer] check @param
  • [ ] [Analyzer] check @throws
  • [ ] [Analyzer] check @return
  • [x] #79
  • [ ] #80
  • [ ] missing-doc analyzer: add check for docblocks of parents/interfaces etc. since they are inherited

to add to the list above:

  • @todo
  • @var
  • @property
  • @property-read
  • @property-write

ddmler avatar Sep 15 '16 09:09 ddmler