问题
I have a compound statement in one of my classes and as far as I know I'm following the phpDoc docs here. This is just the relevant part of the file. The file itself and the class do have docblocks.
class contact {
/**
* @var PDO $pdo The PDO class for database communication
* @var int $id The id of the contact
* @var int $clientId The id of the client the contact is linked to
* @var string $name The name of the contact
* @var string $address The first address line (normally street and house number) of the contact
* @var string $postal_code The postal code of the contact
* @var string $city The city of the contact
* @var string $state The state or region of the contact
* @var string $country The country of the contact
*/
protected $pdo, $id, $clientId, $name, $address, $postal_code, $city, $state, $country;
When I run phpdoc on this file, it's parsed fine without any output. However, when I look at the generated docs, the information isn't displayed correctly:
![](https://www.eimg.top/images/2020/03/22/5323cf88f03864229b2848c5c60ed3a2.png)
What am I doing wrong?
回答1:
This is supposed to be supported in phpDocumentor 2.x, though it was not in 1.x. Since that looks like a 2.x output template, this is likely a bug in the template that you could report as an Issue at the Github repo (https://github.com/phpDocumentor).
来源:https://stackoverflow.com/questions/26067905/phpdoc-var-for-compound-statement-isnt-displayed-correctly