# phpstan/phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics

Repository: https://github.com/phpstan/phpdoc-parser
Canonical: https://ross.abutalabs.com/products/phpdoc-parser
Language: PHP
License: MIT
License Family: permissive
Topics: phpstan, static-analysis, php, php7, testing, static-code-analysis, static-analyzer, phpdoc
Last push: 2026-08-17T06:38:29+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 92, longevity 100
- inputs: {"age_days": 3209, "days_push": 16, "days_rel": 56, "gap_med": 20.5, "n_releases_24m": 13}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1533, forks 74 (observed 2026-08-28T04:04:59.633008+00:00)

## What it is
A PHP library that parses PHPDoc comments into an abstract syntax tree, supporting modern type syntax like generics, intersection types, array shapes, and conditional types. It also parses Doctrine Annotations and provides visitor-based AST traversal for reading and transforming PHPDocs.

## Use cases
- parse phpdoc annotations from php source code
- extract type information from doc comments
- modify phpdoc comments programmatically
- parse generics and intersection types in phpdoc
- analyze doctrine annotations in php projects
- build a static analysis tool for php

## When to choose
- you need a robust PHPDoc parser with an AST representation
- you're building static analysis or code tooling for PHP
- you need to support modern PHPDoc type syntax like generics and conditional types
- you need to parse or transform Doctrine Annotations

## When to avoid
- you need to parse PHP code itself rather than PHPDoc comments
- you need a runtime type validation library rather than a parser
- your project is not written in PHP

## Facets
- artifact type: library
- maturity: stable
- function: parser, static-site-generator
- domain: parsers, developer-tools, programming-languages
- platform: php
- tags: phpdoc, static-analysis, ast, phpstan, doctrine-annotations, type-syntax

## Member repositories
- phpstan/phpdoc-parser (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:59.633008+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:31:16.073525+00:00, confidence not recorded.
  - readme: https://github.com/phpstan/phpdoc-parser (fetched 2026-08-28T04:04:59.633008+00:00, sha 484e618a50f9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
