type-lang / phpdoc-standard-tags
Adds support for standard PHPDoc tags
Package info
github.com/php-type-language/phpdoc-standard-tags
pkg:composer/type-lang/phpdoc-standard-tags
Requires
- php: ^8.1
- type-lang/parser: ^1.0
- type-lang/phpdoc: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.53
- nikic/php-parser: ^4.19|^5.0
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^10.5|^11.0
- symfony/finder: ^5.4|^6.0|^7.0
- type-lang/printer: >=1.0.0-beta2 <2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-07-12 18:46:07 UTC
README
Abandoned: Since version 2.0, this phpdoc tag set is built-in to the phpdoc package.
Adds support of the PHPDoc standard DocBlock tags.
Read documentation pages for more information.
Installation
TypeLang PHPDoc Standard Tags is available as Composer repository and can be installed using the following command in a root of your project:
composer require type-lang/phpdoc-standard-tags
Introduction
Adds support for basic annotations containing descriptions of types that affect their output in static analyzers.
-
@method—TypeLang\PHPDoc\Standard\MethodTagFactory -
@param—TypeLang\PHPDoc\Standard\ParamTagFactory -
@property—TypeLang\PHPDoc\Standard\PropertyTagFactory -
@property-read—TypeLang\PHPDoc\Standard\PropertyReadTagFactory -
@property-write—TypeLang\PHPDoc\Standard\PropertyWriteTagFactory -
@return—TypeLang\PHPDoc\Standard\ReturnTagFactory -
@throws—TypeLang\PHPDoc\Standard\ThrowsTagFactory -
@var—TypeLang\PHPDoc\Standard\VarTagFactory
Usage
use TypeLang\PHPDoc\Parser; use TypeLang\PHPDoc\Standard; use TypeLang\PHPDoc\Tag\Factory\TagFactory; $tags = new TagFactory(); // Add support of standard tags $tags->register('method', new Standard\MethodTagFactory()); $tags->register('param', new Standard\ParamTagFactory()); $tags->register('property', new Standard\PropertyTagFactory()); $tags->register('property-read', new Standard\PropertyReadTagFactory()); $tags->register('property-write', new Standard\PropertyWriteTagFactory()); $tags->register('return', new Standard\ReturnTagFactory()); $tags->register('throws', new Standard\ThrowsTagFactory()); $tags->register('var', new Standard\VarTagFactory()); $docblock = (new Parser($tags)) ->parse(<<<'PHPDOC' /** * @var string example tag. */ PHPDOC); var_dump($docblock);