本文介绍了复合语句的phpDoc @var无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的一个类中有一个复合语句,据我所知,我遵循)。


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:

What am I doing wrong?

解决方案

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).

这篇关于复合语句的phpDoc @var无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 00:34