symfony/inflector
Deprecated since Symfony 5.1. Symfony Inflector converts English words between singular and plural forms. Use the String component’s EnglishInflector instead. Issues and PRs should be filed in the main Symfony repository.
v5.4.47 (correcting spellings in EnglishInflector) is non-functional, reinforcing its role as a stable, low-risk addition for string manipulation. The package’s archival status persists, making it suitable only for non-critical use cases where minimal maintenance overhead is acceptable.Str helpers but provides extended pluralization rules (e.g., irregular forms like "child/children") and standalone usability—critical for non-Laravel contexts (microservices, CLI tools). The spelling fix does not alter this dynamic.symfony/polyfill dependencies). The fix itself is internal and benign, but the broader risk of feature stagnation or security neglect persists.composer require symfony/inflector). The spelling fix has no API impact and does not modify method signatures or behavior.Inflector::pluralize(), Inflector::singularize()) are unaffected.EnglishInflector logic.assertEquals('boxes', Inflector::pluralize('box'))). However, the spelling fix may improve edge-case accuracy (e.g., "child" → "children"), warranting updated test coverage for previously inconsistent outputs.voku/portable-ascii) remain necessary for long-term use.Str or symfony/intl.symfony/polyfill) should be proactively audited given the package’s archival status.Str helpers?
Str::plural()/Str::singular() are preferred due to active maintenance.symfony/polyfill) to mitigate security risks? Use composer why symfony/inflector to identify transitive dependencies.symfony/* packages? Use composer why-not symfony/inflector to check for version clashes.spatie/array-to-xlsx for non-pluralization use cases)?$this->app->singleton('inflector', fn() => new \Symfony\Component\String\Inflector());
Inflector::plural('box')).Str is unavailable.$this->assertEquals('children', Inflector::pluralize('child'));
$this->assertEquals('persons', Inflector::pluralize('person')); // If applicable
deprecated() helper if migrating from custom logic.Str with custom logic for irregular plurals:
Str::plural('child'); // Returns 'childs' (default); override with custom rules.
symfony/polyfill for security risks. Pin the version in composer.json to avoid accidental updates:
"symfony/inflector": "5.4.47",
"symfony/polyfill-*:": "v1.27.0" // Example: Pin to a known secure version
composer outdated.var_dump(\Symfony\Component\String\Inflector::rules()) for debugging.Str).Cache::remember("plural_{$word}", now()->addHours(1), fn() => Inflector::pluralize($word));
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package archival | No new features/bugfixes | Fork or switch to Laravel’s Str |
| Incorrect pluralization | UI/API inconsistencies | Add tests for edge cases; override Str logic if needed |
| Dependency conflicts | Composer install failures | Use composer why-not symfony/inflector; pin versions |
| PHP version incompatibility | Runtime errors | Pin PHP version in composer.json |
| Security vulnerabilities | Exploitable dependencies | Audit symfony/polyfill; fork if necessary |
How can I help you explore Laravel packages today?