PluralRule final readonly class
Minn\I18n\PluralRule · public/minn/src/Minn/I18n/PluralRule.php · 36 lines
A language's plural rule from its Plural-Forms header: how many forms it has and which form a number takes. A file without the header follows English (two forms, n != 1); an expression that does not parse sends every number to the first form, as the reference does.
Uses 1
Used by 1
Constants and properties
| prop | readonly int $count | Promoted from the constructor. |
| prop | readonly string $expression | Promoted from the constructor. |
| private | readonly ?array $tree | Promoted from the constructor. |
Public
| new | __construct(int $count, string $expression, ?array $tree)# |
| |||
| static | english(): self# | English: one form for 1, the other for everything else. | |||
| static | fromHeader(?string $header): self# | The rule a Plural-Forms header states. | |||
| static | fromExpression(int $count, string $expression): self# | A rule from a form count and an expression in n. | |||
| method | index(int $n): int# | The form a number takes. |
Nothing matches.