Inflectible.php
1 month ago
InflectorFactory.php
1 month ago
Rules.php
1 month ago
Uninflected.php
1 month ago
Rules.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | declare (strict_types=1); |
| 4 | namespace IAWPSCOPED\Doctrine\Inflector\Rules\English; |
| 5 | |
| 6 | use IAWPSCOPED\Doctrine\Inflector\Rules\Patterns; |
| 7 | use IAWPSCOPED\Doctrine\Inflector\Rules\Ruleset; |
| 8 | use IAWPSCOPED\Doctrine\Inflector\Rules\Substitutions; |
| 9 | use IAWPSCOPED\Doctrine\Inflector\Rules\Transformations; |
| 10 | /** @internal */ |
| 11 | final class Rules |
| 12 | { |
| 13 | public static function getSingularRuleset() : Ruleset |
| 14 | { |
| 15 | return new Ruleset(new Transformations(...Inflectible::getSingular()), new Patterns(...Uninflected::getSingular()), (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions()); |
| 16 | } |
| 17 | public static function getPluralRuleset() : Ruleset |
| 18 | { |
| 19 | return new Ruleset(new Transformations(...Inflectible::getPlural()), new Patterns(...Uninflected::getPlural()), new Substitutions(...Inflectible::getIrregular())); |
| 20 | } |
| 21 | } |
| 22 |