whatisgithub

What is inflector?

doctrine/inflector — explained in plain English

Analysis updated 2026-06-24

11,354PHPAudience · developerComplexity · 2/5Setup · easy

In one sentence

A small PHP library that converts English words between singular and plural forms and transforms text between casing styles like camelCase and underscored format, commonly used inside PHP frameworks and ORMs.

Mindmap

mindmap
  root((repo))
    What it does
      Singular to plural
      Plural to singular
      Case conversion
    Use cases
      ORM table names
      URL slugs
      Display labels
    Tech
      PHP library
      Doctrine project
    Audience
      PHP developers
      Framework builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically derive database table names from PHP class names in an ORM or custom framework

USE CASE 2

Display item counts with correct English pluralization in a web application interface

USE CASE 3

Convert variable or method names between camelCase and underscored formats in PHP code generation

What is it built with?

PHP

How does it compare?

doctrine/inflectorphpoffice/phpexcelpestphp/pest
Stars11,35411,37811,470
LanguagePHPPHPPHP
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

So what is it?

Doctrine Inflector is a small PHP library that handles two common text transformation tasks: changing the case of words (uppercase versus lowercase, camelCase versus underscored formats) and converting between singular and plural forms of English words. This kind of functionality is a recurring need in web applications. A framework or ORM (object-relational mapper, software that connects code objects to database tables) often needs to automatically derive a table name from a class name, or display a count of items using the correct grammatical form. Rather than writing and maintaining that logic in every project, Inflector provides it in a dedicated library. The library is part of the Doctrine project, a collection of PHP libraries best known for its database tools. Because Doctrine's ORM and related libraries use Inflector internally, it ends up as a dependency in many PHP projects even when developers have not explicitly chosen it. Its high star count likely reflects this widespread indirect usage across the PHP ecosystem. The README for this project is very brief and describes the library in a single sentence. It provides no usage examples, installation instructions, or documentation beyond that description and a pair of build status badges. Anyone looking for detailed documentation would need to consult the Doctrine project's broader documentation resources.

Copy-paste prompts

Prompt 1
Using Doctrine Inflector in PHP, write a function that takes a model class name like UserProfile and returns the expected database table name user_profiles
Prompt 2
Show me how to use Doctrine Inflector to pluralize and singularize English nouns in a PHP controller that displays item counts
Prompt 3
I'm building a PHP code generator that needs to turn class names into URL slugs, use Doctrine Inflector to handle the camelCase-to-hyphenated conversion
Prompt 4
How do I add Doctrine Inflector to a PHP project via Composer and call the tableize method to get a table name from a class name?

Frequently asked questions

What is inflector?

A small PHP library that converts English words between singular and plural forms and transforms text between casing styles like camelCase and underscored format, commonly used inside PHP frameworks and ORMs.

What language is inflector written in?

Mainly PHP. The stack also includes PHP.

How hard is inflector to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is inflector for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.