PHP and Doxygen with multiple property declaration

DevilsJin

I finally got doxygen to work with php and PHPDoc styled comments (I'm removing '@package' with filter since it breaks up doxygen) though there's one thing I would love to have and are not able to figure out how.

In PHP I'm writing multiple property declaration in a class like this:

class Foo
{
private
    /// the blue color
    $blue,
    /// the red color
    $red,
    /// the yellow color
    $yellow;

public
    /// the orange color
    $orange,
    /// black (no color)
    $black;

public function bar() {}
}

If I'm now generating the docs, only the first property is shown as private Attribute while all other properties are simply referenced as Data Fields. So doxygen obviously doesn't parse the accesors of every property after the first one.

Is it possible to make this commentation style compatible to doxygen ?

P.S: I thought about applying a filter which converts it in doxygen-parsable code style. Though this would only be a fix I'm currently working on it.

AbcAeffchen

I wrote this filter, that works for the example you provided. I think it should also work for more complex examples.

// Get the input
$source = file_get_contents($argv[1]);

$count = 0;

do {
    $source = preg_replace('#(private|public|protected)(\s*[^$]*)(\$[^,;]+),#',
                           "$2 $1 $3;\n$1 ", $source, -1, $count);
} while($count > 0);

// Output
echo $source;

You can find this and other filters at my GitHub repository doxygen-php-filters.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Multiple Pointer Declaration With typedef

分類Dev

Multiple languages in doxygen docs (C++)

分類Dev

PHP nullable type declaration

分類Dev

Multiple string variable declaration python

分類Dev

Enforce generic types in java property declaration

分類Dev

What does "!" (bang symbol) mean in a property declaration?

分類Dev

Reactjs create multiple object array declaration

分類Dev

python strange super declaration : multiple self

分類Dev

declaration/initialization issue with multiple files in C++

分類Dev

What is the difference between assigning property values using a constructor and property assignment in the class declaration?

分類Dev

複数のプロパティ宣言を備えたPHPとDoxygen

分類Dev

In PHP, what is the difference between Array and array, in type declaration?

分類Dev

Which PHP documentation comment for variable type declaration is correct?

分類Dev

Can anyone explain this array declaration in PHP -> $a{0} = "value"

分類Dev

Private Property - Object Oriented PHP

分類Dev

Multiple sources bound to same target dependency property

分類Dev

Select one property from multiple expanded properties

分類Dev

Jquery filters array by multiple property and value

分類Dev

TMSL Creating Multiple Partitions Unrecognised JSON property

分類Dev

How to apply a CSS property to multiple elements individualy

分類Dev

PHP multiple errors

分類Dev

DoxygenとJavadoc

分類Dev

CのDoxygen出力

分類Dev

c ++ Doxygen \ example and description

分類Dev

DoxygenのCMake

分類Dev

LuaのDoxygen

分類Dev

Doxygen Search and Replace Output

分類Dev

Php check if object with property exists in array

分類Dev

PHP: set value of static property using variable

Related 関連記事

ホットタグ

アーカイブ