Correct syntax for inheritDoc in phpDocumentor

A child element should be automatically inheriting pretty much everything from its parent docblock without needing this tag. Otherwise, all your implementation methods would have to be documented all over again without gaining anything by the original interface’s documentation. Simply, an inherited element without a docblock should automatically inherit everything from its parent’s docblock. The … Read more

PHPDoc: @return void necessary?

If it makes it clear for the documentation, then leave it in, but it isn’t strictly necessary. It’s an entirely subjective decision. Personally, I would leave it out. EDIT I stand corrected. After a little googling, the wikipedia page says: @return [type description] This tag should not be used for constructors or methods defined with … Read more

Variable type hinting in Netbeans (PHP)

A single line is all you need: /* @var $varName Type_Name */ See this article in the NetBeans PHP Blog: https://blogs.oracle.com/netbeansphp/entry/defining_a_variable_type_in Note: At least, in version 8.2; The key seems to be: The single asterisk (/* instead of /**). Placing the type after the variable name. Having nothing before and after the type-hinting (except white-space, … Read more

Best way to document Array options in PHPDoc?

This is how I do it instead: /** * Class constructor. * * @param array $params Array containing the necessary params. * $params = [ * ‘hostname’ => (string) DB hostname. Required. * ‘databaseName’ => (string) DB name. Required. * ‘username’ => (string) DB username. Required. * ‘password’ => (string) DB password. Required. * ‘port’ … Read more