doctrine/inflector
59.9
Adequate · 13 November 2026
2.3k
lines of production code
PHP
primary language
7
measurements over time
What this system is
Features
Add Italian language support to the inflector
The inflector now supports Italian, allowing users to generate singular and plural forms of Italian words via \InflectorFactory::createForLanguage(Language::ITALIAN)\. This is implemented by adding Italian-specific transformation, irregular, and uninflected rules in \src/Rules/Italian/\, alongside the necessary factory and language constant infrastructure.
src · high confidence
Add Portuguese language inflection rules
Added support for Portuguese pluralization and singularization within the Doctrine Inflector library. The new ruleset in src/Rules/Portuguese handles standard transformations (e.g., -ão to -ões), irregular forms (e.g., cão to cães), and uninflected words (e.g., ônibus, lápis), enabling correct word form conversion for Portuguese text.
src/Rules/French, src/Rules/Portuguese · high confidence
Added inflection rules for Norwegian Bokmål, Spanish, and Turkish
The library now supports pluralization and singularization for Norwegian Bokmål, Spanish, and Turkish. This change introduces new rule sets and factory classes for these languages, enabling correct word form transformations (such as handling irregulars and uninflected words) when using the inflector with these specific locales.
src/Rules/NorwegianBokmal, src/Rules/Spanish, src/Rules/Turkish · high confidence
Initial English pluralization and singularization rules
The library now includes the core rules required to pluralize and singularize English words. This change introduces the \Inflectible\, \Rules\, \Uninflected\, and \InflectorFactory\ classes in the \src/Rules/English\ directory, providing the transformation patterns, irregular word mappings (such as 'die' to 'dice' and 'alga' to 'algae'), and uninflected word lists that power the English inflector.
src/Rules/English · high confidence
Introduce core inflection rule model classes
Added a new set of classes in the \src/Rules\ namespace (\Pattern\, \Patterns\, \Ruleset\, \Substitution\, \Substitutions\, \Transformation\, \Transformations\, and \Word\) that define the data structures and logic for word inflection. These classes handle pattern matching, regular expression compilation, and the application of regular, irregular, and uninflected rules to transform words.
src/Rules · high confidence
Behavioural changes
Repository restructure and license change to MIT
The project has been reorganized into its own component with a new versioning scheme (current 2.1.x, upcoming 2.2) and documentation metadata. The license has changed from LGPL to MIT. Development tooling has been updated to use PHPStan level 10, PHPUnit, and CodeCov, with configuration files added for these tools. The legacy Debug utility class has been removed, and build artifacts like vendor directories and lock files are now excluded from repository archives.
(repo-wide) · high confidence
Test coverage
Added functional tests for English pluralization rules; Added functional tests for Italian and Esperanto inflection rules; Added functional tests for Norwegian Bokmål, Spanish, and Turkish inflection rules; Added functional tests for Portuguese inflection rules; Added test suite for the Doctrine Inflector component; Added unit tests for inflector rules components.
Dependencies
Updated development dependencies and tooling constraints
The project's composer.json has been updated to specify supported PHP versions (^7.2 \|\| ^8.0) and refreshes development dependencies to allow newer major versions of key tools: doctrine/coding-standard (^12.0 \|\| ^14.0), phpstan/phpstan (^1.12 \|\| ^2.0), phpstan/phpstan-phpunit (^1.4 \|\| ^2.0), phpstan/phpstan-strict-rules (^1.6 \|\| ^2.0), and phpunit/phpunit (^8.5 \|\| ^12.2).
(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 61 → 60 (-0.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 100 → 97 (-2.4)
- Architecture 100 → 100 (+0.0)
- Maturity 38 → 40 (+2.4)
- Readiness 75 → 75 (+0.0)
- Security 77 → 70 (-7.6)
Resolved (5)
- Ambiguous semantic intent of 'inflect'. The term 'inflect' is used as a generic transformation verb across multiple layers (core interface, ruleset, and specific rule components). However, in the context of the public API, 'inflect' is also the name of the method on the main Inflector class which performs specific linguistic operations (singularize/pluralize). While technically distinct (one is a low-level transformation, others are high-level linguistic ops), the naming collision between the low-level WordInflector.inflect and the high-level Inflector.singularize/pluralize creates a slight cognitive load. More critically, RulesetInflector uses inflect while the factory pattern InflectorFactory produces an Inflector that uses singularize/pluralize. This suggests a split in terminology: low-level rules 'inflect', high-level objects 'singularize' or 'pluralize'.
- Documentation: no installation or build instructions (docs/en/index.rst)
- Documentation: no usage examples (docs/en/index.rst)
- Duplicated block (9–13 lines × 2) (src/Rules/Italian/Inflectible.php)
- Orphaned file (src/Inflector.php)
New (1)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 6 commits — 4 feature/other, 2 fixes
By area
- (repo) — 3 commits
- (root) — 1 commit
- .github/workflows — 1 commit
- src/Rules — 1 commit
Notable commits
- fix: Merge pull request #353 from Gabrieljr42/fix/217-cyrillic-unaccent
- fix: Merge pull request #355 from Gabrieljr42/fix/169-preserve-radius-singular
- change: Bump the doctrine group with 6 updates
- change: Delete obsolete SECURITY.md
- change: Merge pull request #357 from doctrine/dependabot/github_actions/doctrine-3c6573303e
- change: Preserve radius when singularizing English words
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/inflector 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 1222eb5b557ae4eadd75b83ee62fc219d6187f03 — 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.