Skip to content
CAI
Software that uses CAICheck a score

doctrine/collections

62.6

Adequate · 19 September 2026

1.6k

lines of production code

PHP

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the Doctrine Collections library, a PHP component for managing collections of objects. It provides functionality for filtering, sorting, and matching collection items using expression visitors and criteria. The codebase focuses on modernizing the API by enforcing strict typing, immutability, and compatibility with recent PHP versions.

Features

Initial project scaffolding and configuration for Doctrine Collections

This change establishes the foundational structure for the Doctrine Collections library, introducing essential configuration files including \.doctrine-project.json\ for versioning and website metadata, \.gitattributes\ and \.gitignore\ to manage repository exports, and coding standards configurations for PHPStan, PHPCS, and PHPUnit. It also adds standard project documentation such as \README.md\, \CONTRIBUTING.md\, \LICENSE\ (MIT), and \SECURITY.md\, alongside a comprehensive \UPGRADE.md\ guide detailing breaking changes and deprecations across versions 2.0 through 3.1, such as the transition to native types, readonly/final classes, and the removal of legacy APIs like \accessRawFieldValues\.

(repo-wide) · high confidence

Behavioural changes

Deprecate legacy ordering types and remove no-op accessRawFieldValues parameter

The \accessRawFieldValues\ parameter has been removed from \Criteria::create()\ and the \Criteria\ constructor, as it has been a no-op since version 3.0; passing it now triggers a deprecation warning. Additionally, the legacy \Order\ enum is deprecated in favor of the native \SortDirection\ enum, and the \Criteria::orderings()\ method is deprecated in favor of \getOrderings()\, which now returns \SortDirection\ values. These changes streamline the API by aligning with modern PHP standards and removing unused configuration options.

src · high confidence

Expression visitor now uses reflection-based field access

The \ClosureExpressionVisitor\ in \src/Expr\ has been updated to use reflection-based, direct field access for retrieving object properties, replacing the previous mechanism. This change is accompanied by the deprecation of the \accessRawFieldValues\ constructor parameter, which is now a no-op and will be removed in a future version. The visitor also leverages native PHP array functions (\array\_all\, \array\_any\) for evaluating composite expressions and ensures all expression classes are marked as final and readonly for better performance and immutability.

src/Expr · high confidence

Test coverage

Added static analysis test fixtures for Collection interface; Added test suite for lazy collection initialization and expression visitor; Added unit tests for Expression classes.

Dependencies

Update dependencies and require PHP 8.4

The project now requires PHP 8.4 and has updated its development dependencies, including upgrading PHPUnit to version 12.4, PHPStan to 2.1.30, and Doctrine Coding Standard to 14. The main library also depends on doctrine/deprecations ^1 and symfony/polyfill-php86 ^1.36.

(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 63.

Lenses

  • Code Health 96
  • Architecture 100
  • Maturity 43
  • Readiness 72
  • Security 82

Changes since last survey

  • 300 commits — 283 feature/other, 17 fixes

By area

  • (repo) — 150 commits
  • (root) — 53 commits
  • .github/workflows — 42 commits
  • docs/en — 13 commits
  • lib/Doctrine — 8 commits
  • src/ArrayCollection.php — 7 commits
  • src/Expr — 7 commits
  • .github/dependabot.yml — 4 commits
  • src/AbstractLazyCollection.php — 4 commits
  • src/Criteria.php — 2 commits
  • src/ReadableCollection.php — 2 commits
  • tests/Expr — 2 commits
  • src/Collection.php — 1 commit
  • src/Selectable.php — 1 commit
  • stubs/array_find.phpstub — 1 commit
  • tests/ArrayCollectionTest.php — 1 commit
  • tests/Common — 1 commit
  • tests/Doctrine — 1 commit

Notable commits

  • fix: Fix CS (#410)
  • fix: Fix deprecated Serializable usage (#425)
  • fix: Fix markup
  • fix: Fix redundant usage of stable-slug
  • fix: Fix reporting of deprecations in tests
  • fix: Merge pull request #323 from greg0ire/fix-optional-arg
  • fix: Merge pull request #327 from greg0ire/fix-signature-compatibility
  • fix: Merge pull request #331 from greg0ire/revert-return-type-additions
  • fix: Merge pull request #336 from greg0ire/fix-upgrade
  • fix: Merge pull request #359 from LVoogd/fix/explicit-return-types
  • fix: Merge pull request #390 from greg0ire/fix-doc-job
  • fix: Merge pull request #405 from derrabus/bugfix/deprecation-message
  • fix: Merge pull request #427 from greg0ire/fix-headings
  • fix: Merge pull request #459 from SenseException/config-stable-fix
  • fix: Merge pull request #479 from mpdude/fix-test-deprecation-reporting
  • fix: Merge pull request #514 from greg0ire/fix-sa
  • fix: Merge pull request #551 from dmitryuk/fix-selectable
  • change: Add Override attribute where applicable
  • change: Add SECURITY.md to link to reporting policy and email.
  • change: Add a NOT CompositeExpression in order to filter-out
  • …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/collections 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 e292686c9c192211c191d7b288097ca564ad8616 — 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.