doctrine/annotations
60.0
Adequate · 19 September 2026
2.9k
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is the Doctrine Annotations library, a standalone PHP component designed for parsing and validating docblock annotations. It provides core functionality including a lexer, parser, and reader implementations, along with validation features for types, targets, and enums. The project is now in maintenance mode, having been superseded by native PHP attributes, and focuses on bug fixes and security patches for PHP 7.2+ environments.
How it got here
2007–2009 — Annotation component extraction and modernization
4 changes.
The project extracted the Doctrine Annotations functionality into a standalone library, introducing a comprehensive test suite and modernizing the codebase for newer PHP versions. This period focused on establishing a robust, self-contained component with improved parsing, error handling, and infrastructure, while simultaneously deprecating older APIs in favor of native PHP attributes.
2013 — Annotation parsing robustness
3 changes.
This period focused on strengthening the Doctrine Annotations library by expanding test coverage for complex parsing edge cases, including enum values, syntax errors, and namespace resolution. Concurrently, dependencies were updated to enforce modern PHP version requirements and align with current development tooling standards.
2014–2019 — Annotation validation and testing enhancements
5 changes.
This period focused on expanding the Doctrine Annotations library with new features for type, target, and enum validation, including support for function targets and named argument constructors. Significant effort was also dedicated to improving code quality and reliability by adding comprehensive unit tests, test fixtures for trait handling, and performance benchmarks using PHPBench.
Features
Doctrine Annotations component extracted to standalone library
The Doctrine Annotations functionality has been extracted into a standalone \Doctrine/Common/Annotations\ package, separating it from the main Doctrine Common library. This new component provides a complete, self-contained implementation for parsing docblock annotations, including a new \Annotation\ base class, a \Reader\ interface with implementations like \AnnotationReader\ and \PsrCachedReader\, and a dedicated parser (\DocParser\) and lexer (\DocLexer\). The extraction includes support for modern PHP features (such as PHP 8 use statements and named arguments), improved error handling via \AnnotationException\, and a centralized list of implicitly ignored annotations (\ImplicitlyIgnoredAnnotationNames\) to reduce noise from non-standard docblock tags.
lib/Doctrine/Common/Annotations · high confidence
New annotation classes for type, target, and enum validation
The Doctrine Annotations library now includes several new annotation classes that enhance parsing validation and configuration. The new \Attribute\ and \Attributes\ annotations allow developers to specify expected types for annotation properties, enabling the parser to validate attribute types during the parsing process. A new \Enum\ annotation provides built-in validation for scalar values and literal mappings, ensuring that only defined enumerators are accepted. The \Target\ annotation has been updated to support a \FUNCTION\ target (in addition to CLASS, METHOD, PROPERTY, and ANNOTATION) and properly implements bitmask logic for target validation. Additionally, \NamedArgumentConstructor\ allows annotations to be instantiated using named arguments, and \IgnoreAnnotation\ now supports passing annotation names as an array for easier exclusion of multiple annotations.
lib/Doctrine/Common/Annotations/Annotation · high confidence
Behavioural changes
Doctrine Annotations 2.0 release and deprecation notice
The library has been released as version 2.0, marking the end of active development in favor of native PHP attributes. This release removes several deprecated APIs, including \NamedArgumentConstructorAnnotation\, \SimpleAnnotationReader\, \CachedReader\, \FileCacheReader\, and \AnnotationRegistry\ methods, while adding strict parameter type declarations to all classes. It also drops support for PHP versions below 7.2 and updates the underlying \doctrine/lexer\ dependency to version 2. The project is now considered feature-complete, with maintenance limited to bugfixes and security patches.
(repo-wide) · high confidence
Test coverage
Added PHPBench performance benchmarks for Doctrine Annotations; Added annotation fixture classes for testing; Added test fixtures for trait annotation parsing scenarios; Added tests for annotation parsing edge cases; Added unit tests for Annotation Target bitmasking; Establishes base test infrastructure and bootstrap for Doctrine tests; Expanded test fixtures for Doctrine Annotations parsing edge cases; Initial test suite for Doctrine Annotations component.
Dependencies
Doctrine Annotations package marked as abandoned with updated dependencies
The Doctrine Annotations library is now marked as abandoned, encouraging users to migrate to PHP 8.0+ native attributes. The package has been updated to require PHP 7.2 or 8.0, doctrine/lexer 2 or 3, and PSR-cache 1, 2, or 3. Development dependencies have also been updated to include phpunit 7.5/8.5/9.5, phpstan 1.11/2.1, and vimeo/psalm 4.30/5.14.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 60.
Lenses
- Code Health 90
- Architecture 100
- Maturity 43
- Readiness 63
- Security 81
Changes since last survey
- 300 commits — 267 feature/other, 33 fixes
By area
- (repo) — 122 commits
- (root) — 61 commits
- lib/Doctrine — 48 commits
- docs/en — 29 commits
- tests/Doctrine — 24 commits
- .github/workflows — 16 commits
Notable commits
- fix: Add a test and fix the behavior of issue #141
- fix: Automated fixes
- fix: Fix CI
- fix: Fix CS
- fix: Fix badges
- fix: Fix broken autoloading due to Reader calling registerFile
- fix: Fix checks for ignored annotations
- fix: Fix duplicate text in documentation
- fix: Fix filemtime() warning because of eval'd code (#494)
- fix: Fix ignoring imported ignored annotations
- fix: Fix link to Coding Standard Guidelines
- fix: Housekeeping: phpcs fixes
- fix: Manually fix coding style issues
- fix: Merge pull request #142 from mikeSimonson/fix-141
- fix: Merge pull request #244 from dbu/fix-ignored-annotations
- fix: Merge pull request #316 from alcaeus/fix-ignored-annotation-names
- fix: Merge pull request #318 from alcaeus/fix-ignored-annotations
- fix: Merge pull request #323 from alcaeus/fix-annotation-autoloading
- fix: Merge pull request #341 from greg0ire/fix-broken-build
- fix: Merge pull request #355 from greg0ire/manual-fixes
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
doctrine/annotations was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 17815fb6b2f4c3c701ba2abdf2c6c97b219fb2e4 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.