doctrine/persistence
60.7
Adequate · 17 November 2026
2.7k
lines of production code
PHP
primary language
5
measurements over time
What this system is
Features
Initial project scaffolding and configuration for Doctrine Persistence
This change establishes the foundational configuration files for the Doctrine Persistence library. It introduces the \.doctrine-project.json\ file to define version branches (including 5.0.x, 4.3.x, and 4.2.x) and metadata for the project website. A \SECURITY.md\ file is added to direct security vulnerability reports to the official Doctrine security team. The \UPGRADE.md\ file documents breaking changes and migration paths for versions 3.0 through 4.2, including the removal of \StaticReflectionService\, the addition of \isUninitializedObject()\ to \ObjectManager\, and the deprecation of modifying metadata directly in PHP mapping files. Standard development tooling is configured via \phpstan.neon\ (level 7), \phpunit.xml.dist\ (with deprecation triggering enabled), and \phpcs.xml.dist\. Additionally, \.gitattributes\ and \.gitignore\ are set up to exclude development artifacts like tests, CI configs, and lock files from distribution archives.
(repo-wide) · high confidence
New Doctrine Persistence library interfaces and base classes
The \src\ directory now contains the core Doctrine Persistence library, introducing the foundational contracts and implementations for the persistence layer. This includes the \ObjectManager\ and \ObjectRepository\ interfaces that define the standard API for managing entities and repositories, as well as the \ManagerRegistry\ and \ConnectionRegistry\ interfaces for accessing multiple managers and connections. An \AbstractManagerRegistry\ implementation is provided to simplify registry creation, and an \ObjectManagerDecorator\ base class is added to facilitate wrapping managers. Additionally, a suite of event argument classes (e.g., \LifecycleEventArgs\, \PreUpdateEventArgs\) is introduced to support lifecycle and metadata events, along with the \Proxy\ interface for lazy loading.
src · high confidence
New reflection classes for PHP enums, proxies, and typed properties
Added three new reflection property classes to handle specific PHP scenarios: EnumReflectionProperty converts backed enum instances to/from their scalar values; RuntimeReflectionProperty avoids triggering lazy loading when working with Doctrine Proxy objects; and TypedNoDefaultReflectionProperty prevents errors when accessing typed properties without default values by checking initialization status and handling NULL assignments via unset.
src/Reflection · high confidence
Behavioural changes
New mapping infrastructure and deprecation of manual metadata setting
The mapping layer introduces a new abstract base class, AbstractClassMetadataFactory, which centralizes metadata loading, caching, and reflection initialization, alongside new interfaces for ClassMetadata, ClassMetadataFactory, ProxyClassNameResolver, and ReflectionService to standardize the mapping contract. A concrete RuntimeReflectionService implementation is provided to handle reflection operations. As part of this restructuring, the ClassMetadataFactory::setMetadataFor() method is deprecated, signaling that users should migrate away from manually setting metadata descriptors in favor of custom factory implementations.
src/Mapping · high confidence
Obsolete Doctrine 1.x code samples removed from manual
The manual/codes directory has been cleared of all PHP code examples that demonstrated the legacy Doctrine 1.x API, including usage of Doctrine\_Manager, Doctrine\_Session, Doctrine\_Record, and Doctrine\_Query. These files are deleted because the documentation is being migrated to the new Doctrine\_DB architecture, rendering the old session-based and record-based code snippets obsolete.
manual/codes · high confidence
Refactored mapping drivers to support ClassLocator and colocated metadata
The mapping driver system has been restructured to decouple class discovery from file location. A new ClassLocator interface and FileClassLocator implementation allow drivers to discover classes from pre-computed lists or file iterators, enabling more efficient metadata loading. The StaticPHPDriver now supports ClassLocator for optimized class discovery, while the ColocatedMappingDriver trait provides shared logic for locating mapping files near source code. File-based drivers now use the FileLocator interface for path management, and the MappingDriverChain has been updated to work with the new driver architecture.
src/Mapping/Driver · high confidence
Test coverage
Added comprehensive test coverage for the Mapping component; Added test coverage for persistence event args, manager registry, and reflection utilities.
Dependencies
Doctrine Persistence 2.0: PHP 8.1+ requirement and dependency modernization
The Doctrine Persistence library has been updated to version 2.0, introducing a strict requirement for PHP 8.1 or higher. This release modernizes the dependency stack by allowing doctrine/event-manager versions 1 and 2, accepting all major versions of psr/cache (1.0, 2.0, and 3.0), and requiring doctrine/deprecations version 1. Development tooling has also been upgraded, with PHPStan pinned to 2.1.30, PHPUnit supporting versions 10.5.58 and 12, and the coding standard updated to version 14.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 60.8 → 60.7 (-0.1)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 70.2 → 69.4 (-0.8)
- Architecture 99.1 → 89.7 (-9.4)
- Maturity 45.3 → 46.4 (+1.1)
- Readiness 74.5 → 74.5 (0.0)
- Security 77.3 → 77.3 (0.0)
Resolved (8)
- Further sole-owners (lower concentration)
- Off-boarding risk: anonymized user #1
- Workflow token permissions not restricted (.github/workflows/coding-standards.yml)
- Workflow token permissions not restricted (.github/workflows/continuous-integration.yml)
- Workflow token permissions not restricted (.github/workflows/documentation.yml)
- Workflow token permissions not restricted (.github/workflows/release-on-milestone-closed.yml)
- Workflow token permissions not restricted (.github/workflows/static-analysis.yml)
- Workflow token permissions not restricted (.github/workflows/website-schema.yml)
New (10)
- Circular dependency (src/ObjectManager.php)
- Edited copy of a member (13 corresponding lines) (src/AbstractManagerRegistry.php)
- Edited copy of a member (25 corresponding lines) (src/Mapping/Driver/SymfonyFileLocator.php)
- High: security finding (details withheld)
- PR-triggered workflow without a permissions block (.github/workflows/coding-standards.yml)
- PR-triggered workflow without a permissions block (.github/workflows/documentation.yml)
- PR-triggered workflow without a permissions block (.github/workflows/static-analysis.yml)
- PR-triggered workflow without a permissions block (.github/workflows/website-schema.yml)
- Workflow holding a long-lived secret is unscoped (.github/workflows/continuous-integration.yml)
- Workflow holding a long-lived secret is unscoped (.github/workflows/release-on-milestone-closed.yml)
Changes since last survey
- 1 commits — 1 feature/other, 0 fixes
By area
- (repo) — 1 commit
Notable commits
- change: Merge pull request #530 from doctrine/add-target-branch-check
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
doctrine/persistence 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 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7f0356899a8a9d09fe5bfe67df04b63ad5bf4c16 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.