Skip to content
CAI
Software that uses CAICheck a score

doctrine/lexer

57.2

Adequate · 13 November 2026

353

lines of production code

PHP

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Initial release of Doctrine Lexer with project scaffolding

This entry marks the initial commit of the Doctrine Lexer component, providing the foundational library for Top-Down, Recursive Descent Parsers used by Doctrine Annotations and ORM. The release includes the core source code, a comprehensive test suite, and standard project configuration files such as PHPUnit, PHPStan, and PHPCS. It also establishes the licensing (MIT), security reporting guidelines, and upgrade documentation for versions 2.0 and 3.0, which detail breaking changes like the removal of ArrayAccess from the Token class and the addition of type declarations.

(repo-wide) · high confidence

New lexer infrastructure with templated token types and position-based navigation

This change introduces the core lexer components in src/AbstractLexer.php and src/Token.php, enabling users to build simple DSLs with strongly typed tokens. The Token class now supports templated value types (V) including string, int, float, and bool, allowing for more precise type handling in lexical analysis. The AbstractLexer provides position-based navigation via resetPosition(int $position), which accepts a character offset and finds the corresponding token index, supporting past-the-end resets. Users can now leverage conditional types and template parameters for better type safety when creating custom lexers.

src · high confidence

Removals

Removal of AbstractLexer base class

The \lib/Doctrine/Common/Lexer/AbstractLexer.php\ file has been completely removed from the codebase. This eliminates the legacy base class used for writing simple lexers and DSLs, meaning any code relying on \Doctrine\\Common\\Lexer\\AbstractLexer\ will no longer function and must be migrated to the new lexer implementation or alternative approach.

lib/Doctrine · high confidence

Test coverage

Added test suite for the Lexer component

Added comprehensive tests for the Doctrine Lexer, including \AbstractLexerTest\ which verifies token navigation methods like \resetPosition\, \peek\, and \skipUntil\, alongside helper classes (\ConcreteLexer\, \EnumLexer\, \MutableLexer\) and a \TokenTest\ for the Token class.

tests · high confidence

Dependencies

Drops PHP 7.x support and upgrades dev tooling

The library now requires PHP 8.1 or higher, dropping support for earlier versions. Development dependencies have been updated to use doctrine/coding-standard ^14, phpstan/phpstan ^2, and phpunit/phpunit ^10.5.58 \|\| ^12.5.4. The project also migrated its autoloading from PSR-0 to PSR-4, moving source files to the src directory and tests to the tests directory, and updated the homepage URL.

(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

Score

  • CAI 54 → 57 (+3.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 32 → 40 (+8.2)
  • Readiness 75 → 75 (+0.0)
  • Security 77 → 70 (-7.6)

Resolved (2)

  • Off-boarding risk: anonymized user #1
  • Redundant methods with identical intent. In lexer/parser terminology, 'peek' and 'glimpse' are often synonyms for looking at the next token without consuming it. Having both suggests either a historical rename that wasn't cleaned up, or confusion about whether they have different side effects (which is unlikely for a public API).

New (1)

  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 3 commits — 3 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • (root) — 1 commit
  • .github/workflows — 1 commit

Notable commits

  • change: Bump the doctrine group with 6 updates
  • change: Delete obsolete SECURITY.md
  • change: Merge pull request #183 from doctrine/dependabot/github_actions/doctrine-3c6573303e

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/lexer 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 13 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 91e7441c29826260921f052c0028dd21e21e3891 — 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.64+preprod-569132d3dfbe.