PHPackages                             leeroy/php-inflector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. leeroy/php-inflector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

leeroy/php-inflector
====================

PHP Inflector, ported from Rails

1.0.1(3y ago)0271MITPHP

Since May 20Pushed 3y agoCompare

[ Source](https://github.com/LeeroyLabs/php-inflector)[ Packagist](https://packagist.org/packages/leeroy/php-inflector)[ RSS](/packages/leeroy-php-inflector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP Inflector [![Build Status](https://camo.githubusercontent.com/b410a3dd8510ab8608b5a9a782aee0ee0f3be1538b301dc9de1966ba4ff6b034/68747470733a2f2f7472617669732d63692e6f72672f6b6f656e70756e742f7068702d696e666c6563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/koenpunt/php-inflector)
===============================================================================================================================================================================================================================================================================================================

[](#php-inflector-)

PHP Inflector Library, ported from [Rails](https://github,com/rails/rails)

Minimum Requirements
--------------------

[](#minimum-requirements)

- PHP 5.4+ (support for PHP 5.3 in [php-5.3](https://github.com/koenpunt/php-inflector/tree/php-5.3) branch)
- PHP [Internationalization extension](http://www.php.net/manual/en/book.intl.php) (`php5-intl`)

Installation
------------

[](#installation)

The easiest way to use PHP Inflector is by installing it with [Composer](https://getcomposer.org/)

Create or update `composer.json`:

```
{
  "require": {
    "koenpunt/php-inflector": "1.0.*"
  }
}
```

And run `composer install`

Features
--------

[](#features)

- Basics:

    - singularize
    - pluralize
    - singularize
    - camelize
    - underscore
    - humanize
    - titleize
    - tableize
    - classify
    - dasherize
    - denamespace
    - foreign\_key
    - ordinalize
- Internationalization

    - transliterate
    - parameterize

Usage
-----

[](#usage)

PHP Inflector is implemented as class with static functions

```
Inflector::underscore("PhpInflector\Inflector"); # => php_inflector/inflector

PhpInflector\Inflector::parameterize("Ærøskøbing on Water"); # => aeroskobing-on-water

PhpInflector\Inflector::foreign_key("Admin\Post"); # => post_id

PhpInflector\Inflector::denamespace("PhpInflector\Inflector\Inflections"); # => Inflections

PhpInflector\Inflector::dasherize("puni_puni"); # => puni-puni
```

It is also possible to add custom inflections, like acronyms:

```
PhpInflector\Inflector::inflections(function($inflect){
  $inflect->acronym('RESTful');
});

PhpInflector\Inflector::titleize('RESTfulController'); # => RESTful Controller
```

More examples and documentation can be found in the source.

Contributing
------------

[](#contributing)

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1645 days

Total

2

Last Release

1274d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92767cd5e1ad8cc0aab1bd087488a7356b1d40a37eb17063d023cf3192e5fa78?d=identicon)[Leeroy Digital Agency](/maintainers/Leeroy%20Digital%20Agency)

---

Top Contributors

[![koenpunt](https://avatars.githubusercontent.com/u/351038?v=4)](https://github.com/koenpunt "koenpunt (7 commits)")[![marcLeeroy](https://avatars.githubusercontent.com/u/59919105?v=4)](https://github.com/marcLeeroy "marcLeeroy (1 commits)")[![thudfactor](https://avatars.githubusercontent.com/u/912564?v=4)](https://github.com/thudfactor "thudfactor (1 commits)")

---

Tags

phpinflector

### Embed Badge

![Health badge](/badges/leeroy-php-inflector/health.svg)

```
[![Health](https://phpackages.com/badges/leeroy-php-inflector/health.svg)](https://phpackages.com/packages/leeroy-php-inflector)
```

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
