
Doctrine Inflector
A small PHP library for changing word case and converting words between singular and plural.doctrine/inflector
- Stars
- 11.3k
- Forks
- 144
- Licence
- MIT
- Language
- PHP
- Last update
- 5 days ago
- Type
- Library
What it is
Doctrine Inflector is a small PHP library that handles text transformations on words, such as changing uppercase and lowercase and converting words between singular and plural forms. Developers use it when code needs to turn a name like a table or field label into its singular or plural form, or adjust its capitalization, without writing that logic themselves.
- Convert a model name such as a plural table name to its singular form inside a PHP application
- Change the capitalization of identifiers or labels generated from text
- Generate plural forms of words for display or code generation
Great for
- PHP developers who need singular/plural conversion in their code
- Projects that generate names, labels, or identifiers from words
- Teams already using Doctrine who want a consistent inflection tool
Not ideal for
- Non-PHP projects, since the library is written in PHP
- Anyone needing full natural-language grammar or translation, since the README describes only case and singular/plural handling
- Users looking for an end-user application, since this is a code dependency with no interface
How to get it
- 1
Install with a package manager
You'll need: PHP · Composer
Clone the repository
git clone https://github.com/doctrine/inflector - 2
Run it
- Install the library into a PHP project using Composer (see the project homepage for the exact package command).
- Require the Composer autoloader in your PHP file.
- Call the inflector's singularize or pluralize methods on a word and check the output.
- Consult the project documentation at the homepage for the full list of available methods.
- 3
Get the most out of it
- Read the project homepage documentation for the complete list of transformation methods
- Check the repository's test suite to see example inputs and expected outputs
- Use it alongside other Doctrine packages if your project already uses them
Downloads
Strengths
- Small, focused scope described plainly in the README
- MIT licensed, permissive for commercial and personal use
- Widely starred on GitHub with an active repository
Trade-offs
- The README is brief and does not document the API or supported languages in the excerpt provided
- Scope is limited to case and singular/plural handling only
- Latest release is listed as version 2.1.1 with no binaries, so it is consumed as a code library
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.