Registry / utility / phpstan-phpdoc-parser

phpstan-phpdoc-parser

JSON →
library2.3.2phppackagistunverified

PHPDoc parser with support for nullable, intersection and generic types.

composer require phpstan/phpdoc-parser
INSTALL
IMPORT
SIG · PHPSTAN-PHPDOC-PAR
P
phpstan-phpdoc-parser
utilityphpv2.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PhpDocParser
use PHPStan\PhpDocParser\Parser\PhpDocParser;

Parse a PHPDoc comment into an AST.

use PHPStan\PhpDocParser\Parser\PhpDocParser; use PHPStan\PhpDocParser\Lexer\Lexer; $lexer = new Lexer(); $parser = new PhpDocParser(); $tokens = $lexer->tokenize('/** @param string $name */'); $phpDocNode = $parser->parse($tokens); echo $phpDocNode->getParamTags()[0]->type;
Debug
Known issues
breakingRequires PHP 8.0+
fix
Upgrade PHP to 8.0 or later.
affects: <2.0.0
Upgrade
Version history
2.3.2latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
phpstan-phpdoc-parser — pip install phpstan-phpdoc-parser · libregistry