/var/log

Sami - a PHP API documentation generator

I recently was looking for a way to create clear and nice looking API documentation from a library I made (BSF GitHub and API docs). I looked into phpDocumentor 2, apigen, doxygen and Sami and decided to go for this last one. It has a real nice looking default theme and is themeable with twig.

But one thing that struck me as a bit odd, was the default setting by only documenting the public methods and properties and leaving out the protected ones. You can find a simple solution to show the protected and private ones, but I wanted only the public and protected ones, because this is what a developer using your API has to deal with. See this gist for how to accomplish this. It's really simple: just create your own filter implementing the FilterInterface and return true for the public and protected properties and methods.

Tag: , | Category: