| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Doctrine\Inflector\Rules\Portuguese; |
| 6 | |
| 7 | use Doctrine\Inflector\Rules\Patterns; |
| 8 | use Doctrine\Inflector\Rules\Ruleset; |
| 9 | use Doctrine\Inflector\Rules\Substitutions; |
| 10 | use Doctrine\Inflector\Rules\Transformations; |
| 11 | |
| 12 | final class Rules |
| 13 | { |
| 14 | public static function getSingularRuleset(): Ruleset |
| 15 | { |
| 16 | return new Ruleset( |
| 17 | new Transformations(...Inflectible::getSingular()), |
| 18 | new Patterns(...Uninflected::getSingular()), |
| 19 | (new Substitutions(...Inflectible::getIrregular()))->getFlippedSubstitutions() |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | public static function getPluralRuleset(): Ruleset |
| 24 | { |
| 25 | return new Ruleset( |
| 26 | new Transformations(...Inflectible::getPlural()), |
| 27 | new Patterns(...Uninflected::getPlural()), |
| 28 | new Substitutions(...Inflectible::getIrregular()) |
| 29 | ); |
| 30 | } |
| 31 | } |