{"repo":"phpstan/phpdoc-parser","free":true,"listed":false,"github":"https://github.com/phpstan/phpdoc-parser","clone":"git clone https://github.com/phpstan/phpdoc-parser.git","description":"Next-gen phpDoc parser with support for intersection types and generics","language":"PHP","stars":1533,"topics":["phpstan","static-analysis","php","php7","testing","static-code-analysis","static-analyzer","phpdoc"],"license":"MIT","category":"dev-tools","readme_excerpt":"PHPDoc Parser for PHPStan This library phpstan/phpdoc-parser represents PHPDocs with an AST (Abstract Syntax Tree). It supports parsing and modifying PHPDocs. For the complete list of supported PHPDoc features check out PHPStan documentation. PHPStan is the main (but not the only) user of this library. PHPDoc Basics (list of PHPDoc tags) PHPDoc Types (list of PHPDoc types) phpdoc-parser API Reference with all the AST node types etc. This parser also supports parsing Doctrine Annotations. The AST nodes live in the PHPStan\\PhpDocParser\\Ast\\PhpDoc\\Doctrine namespace. Features Supported type syntax The parser supports a rich type system including: - Basic types: string , int , bool , null , self , static , $this , etc. - Nullable types: ?string - Union and intersection types: string int , Foo&Bar - Generic types with variance: array , Collection - Array shapes: array{name: string, age: int, ...} - Object shapes: object{name: string, age: int} - Callable/closure types: callable(string): bool , Closure(int): void - Conditional types: ($input is string ? string : int) - Offset access types: T[K] - Constant type expressions: self::CONST , 123 , 'string' Constant expression parsing Constant expressions used in PHPDoc tags are parsed via ConstExprParser : - Scalar values: integers, floats, strings, true , false , null - Arrays: {1, 2, 'key' = 'value'} - Class constant fetches: ClassName::CONSTANT AST node traversal The library provides a visitor-based traversal system (inspired by niki","default_branch":null,"files":null,"tree":[],"storefront":"/r/phpstan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/phpstan/phpdoc-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}