Experimenting PHPADD on Doctrine2

Today I tried to unleash PHPADD over Doctrine2 sources.

Of course, it couldn’t even start: it didn’t support namespaces. So I had to improve the analysis of tokenized PHP source and now it works.

By the way, the report was not satisfying as I expected. With a big project such Doctrine you understand how much it is important to have a concise report. So now:

  • the parameters are internally indexed by name. This means that it is easy to detect a changed type, but names changes are still seen as “added param $newName” + “removed param $oldName”.
  • @inheritdoc is supported.
  • multiple types (integer|bool $param) are supported.

This leads to an almost accurate analysis of Doctrine2 ORM classes:

Scanned 261 files with 1672 methods in their classes. 919 methods (55.0%) are regular, 388 methods (23.2%) have no docblock, 365 methods (21.8%) have an outdated docblock.

Since these changes are not in the pear channel yet, if you are lazy&curious the report is here.

This entry was posted in PHPADD. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>