phpdoc-parser
phpdoc-parser copied to clipboard
[PSR-5] param tag with optional values
The param requires a paramname, however, this could be omitted when the param tag is describing just a single argument method or all other params are adequately documented. For example:
/**
* @param int
* /
public function foo($arg): void
{}
/**
* @param int $arg
* @param int Optional description
* /
public function foo($arg, $second): void
{}
I do see this as edge cased, but it makes makes more sense when you align this with other tags for example the @var tag. Which has the same behavior.
class Foo {
/** @var int */
public $bar
}
class Foo {
/**
* @var int
* @var string $foo
*/
public $bar $foo
}
I'm working on a pr to support this.