Search code examples
phpdoc

Where to write phpDoc? Interface or class


Where should I write phpDoc? Upon interface in interface file or upon class that implements the interface? I am a bit sad that I can't write return types and types of params before param in methods. In PHP I have to do that in phpDoc, but where should I write this?


Solution

  • I would write the docblock in the interface. If there is something specific for some class, you could write docblock for it.

    You can specify argument types, see http://php.net/manual/en/language.oop5.typehinting.php