Search code examples
phpconstructorannotationsmarkupphpdoc

PHPDoc - how to mark constructor function in PHP


In JSDoc i can mark my constructor function with @constructor. Now i tried to find in the PHPDoc specs how to do the same for a PHP constructor but they never mention anything similar. What is the proper way to mark my constructor in PHP.

This:

/**
 * @constructor
 */
public function __construct()
{

}

Seems to be invalid.


Solution

  • PHP documentation generators will recognize the __construct() method as the constructor. No special tag is required.