mmucklo/inflect
inflect - a memoizing inflector for php
v2.0.0
25M downloads/mo
#1029 most downloaded on Packagist
mmucklo/inflect
What this package is like to depend on
Last release 4 months ago
13 Apr 2026
Release timing varies
gaps range from 5 months to 10.9 years
Some releases are documented
notes for 2 of 5 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
5 releases · first in 2013
1 release in the last 12 months
see the full history below
Release timeline
5 releases · Jul 2013 to Apr 2026Releases
latest 5-
v2.0.013 Apr 2026Release notes
Open source →First major release of
mmucklo/inflectin over a decade. Modernizes the PHP baseline, ports tests to PHPUnit 10, moves to PSR-4, adds GitHub Actions CI with Codecov and Scrutinizer, tightens types, and expands correctness.⚠️ Breaking changes
- PHP 8.1+ required. Previous floor was PHP 5.3.17. Callers on ≤ PHP 8.0 cannot upgrade — stay on the
php5.3branch for back-ported fixes to the legacy baseline. - PSR-4 file layout.
src/Inflect/Inflect.phpmoved tosrc/Inflect.php. Composer autoload changed frompsr-0topsr-4.autoload.php.distwas removed. Inflectis nowfinal. Subclassing is no longer supported. Locale support (v2.2) will extend via composition.- Static rule tables (
\$plural,\$singular,\$irregular,\$uncountable) and caches are nowprivate. External code that was reading or mutating these will break. Supported extension APIs are roadmap §5 (v2.1). pluralize(null)/singularize(null)now throwTypeError. Previously returnednullsilently. Empty strings still return''without error.pluralizeIfuses strict comparison (===) for the count check. Callers passing'1'as a string now hit the plural branch.phpunit.xml-distrenamed tophpunit.xml.dist(PHPUnit 10 convention). CI automation reading the old name must update.
✨ Added
- GitHub Actions CI on PHP 8.1 / 8.2 / 8.3 / 8.4 (#13).
- Codecov coverage reporting (98.07% on master) (#13, #16).
- Scrutinizer quality analysis (#13, #17).
- 9 new irregular inflections:
datum/data,criterion/criteria,phenomenon/phenomena,cactus/cacti,nucleus/nuclei,syllabus/syllabi,curriculum/curricula,medium/media,bacterium/bacteria(#9). - 10 new uncountables:
news,aircraft,software,hardware,luggage,advice,traffic,furniture,metadata,multimedia(#9). - Case preservation on irregular transforms:
Man → Men,Children → Child(previously lowercased) (#9). - Double-inflection guard:
pluralize('people')now returns'people'(was'peoples');singularize('datum')stays'datum'(was'data') (#9). - Case-insensitive uncountable lookup in
pluralize()to matchsingularize()behavior (#9). declare(strict_types=1), string/int parameter and return types on all public methods (#14).- Typed static properties (PHP 7.4+ syntax) (#14).
- Expanded test suite: 117 tests / 118 assertions, ported to namespaced
PHPUnit\Framework\TestCasewith#[DataProvider]attributes (#12, #14). - ROADMAP.md documenting planned improvements and the locale-support path (A: vendored; B: sibling
mmucklo/inflectionspackage) (#8, #11, #15).
🔧 Changed
- PHPUnit bumped from
3.7.*to^10.5(#12). - Autoload switched from PSR-0 to PSR-4; tests live in the
Inflect\Testsnamespace (#12). - Short array syntax (
[]) throughout the class (#14). - Issue #4 fix (singularization of
-sswords likebusiness,wellness) is included.
🗑 Removed
autoload.php.dist— obsoleted by Composer PSR-4 autoload..travis.yml— replaced by GitHub Actions.
🌿 Branching
master— active development, PHP 8.1+.php5.3— back-port branch for critical fixes on the legacy baseline. All v2.0 correctness fixes were back-ported (#10).
Full PR list
#8, #9, #10, #11, #12, #13, #14, #15, #16, #17
🤖 Release notes generated with assistance from Claude Code.
Release notes
Open source →Major release. Modernizes the PHP baseline, ports tests to PHPUnit 10, moves to PSR-4, adds GitHub Actions CI with Codecov and Scrutinizer, tightens types, and expands correctness.
⚠️ Breaking
- PHP 8.1+ required (was PHP 5.3.17+). Stay on the
php5.3branch for back-ported fixes to the legacy baseline. ([#12]) src/Inflect/Inflect.phpmoved tosrc/Inflect.php. Autoload changed from PSR-0 to PSR-4.autoload.php.distremoved. ([#12])Inflectclass is nowfinal. ([#14])- Static rule tables (
$plural,$singular,$irregular,$uncountable) and memoization caches are nowprivate. External code reading or mutating them will break. ([#14]) pluralize(null)andsingularize(null)now throwTypeError. Empty strings still return''. ([#14])pluralizeIfuses strict comparison (===) for the count check. ([#14])phpunit.xml-distrenamed tophpunit.xml.dist. ([#12])
Added
- GitHub Actions CI matrix on PHP 8.1 / 8.2 / 8.3 / 8.4. ([#13])
- Codecov integration (98.07% coverage on master). ([#13], [#16])
- Scrutinizer integration. ([#13], [#17])
- 9 new irregular inflections:
datum/data,criterion/criteria,phenomenon/phenomena,cactus/cacti,nucleus/nuclei,syllabus/syllabi,curriculum/curricula,medium/media,bacterium/bacteria. ([#9]) - 10 new uncountables:
news,aircraft,software,hardware,luggage,advice,traffic,furniture,metadata,multimedia. ([#9]) - Case preservation on irregular transforms:
pluralize('Man') === 'Men',singularize('Children') === 'Child'. ([#9]) - Double-inflection guard:
pluralize('people') === 'people',singularize('datum') === 'datum'. ([#9]) - Case-insensitive uncountable lookup in
pluralize()(matchessingularize()behavior). ([#9]) declare(strict_types=1), typed parameters and return types on all public methods. ([#14])- Typed static properties (PHP 7.4+ syntax). ([#14])
ROADMAP.mddocumenting planned improvements and the locale-support path. ([#8], [#11], [#15])
Changed
- PHPUnit upgraded from
3.7.*to^10.5. Tests ported to namespacedPHPUnit\Framework\TestCase,#[DataProvider]attributes, strict types. ([#12]) - Composer autoload switched from PSR-0 to PSR-4. Tests live in the
Inflect\Testsnamespace. ([#12]) - Short array syntax (
[]) throughout the class. ([#14]) - Issue #4 fix (singularization of
-sswords likebusiness,wellness) carried forward.
Removed
autoload.php.dist(obsoleted by Composer PSR-4 autoload)..travis.yml(replaced by GitHub Actions).
- PHP 8.1+ required. Previous floor was PHP 5.3.17. Callers on ≤ PHP 8.0 cannot upgrade — stay on the
-
v0.3.016 May 2015Nothing published for this version
-
v0.2.116 May 2015Nothing published for this version
-
v0.2.030 Nov 2013 -
v0.1.014 Jul 2013Nothing published for this version