10 Second Guide to PHPDoc

Screenshot of browser displaying compiled documentation

% wget https://phpdoc.org/phpDocumentor.phar
% sudo mv phpDocumentor.phar /usr/local/bin
% sudo chmod +x /usr/local/bin/phpDocumentor.phar
% sudo ln -s /usr/local/bin/phpDocumentor.phar /usr/local/bin/phpdoc
% phpdoc -d . -t docs/api
/**
* Returns the value of the given Calendar field.
*
* @param int $field The Calendar field to return (e.g., Calendar::YEAR).
*
* @return mixed The value of the supplied Calendar field (e.g., 2022).
*/
public function get(int $field ) { ... }

Comments