InflectorFactory
extends GenericLanguageInflectorFactory
in package
FinalYes
Table of Contents
Properties
- $pluralRulesets : array<string|int, Ruleset>
- $singularRulesets : array<string|int, Ruleset>
Methods
- __construct() : mixed
- build() : Inflector
- Builds the inflector instance with all applicable rules
- withPluralRules() : $this
- Applies custom rules for pluralisation
- withSingularRules() : $this
- Applies custom rules for singularisation
- getPluralRuleset() : Ruleset
- getSingularRuleset() : Ruleset
Properties
$pluralRulesets
private
array<string|int, Ruleset>
$pluralRulesets
= []
$singularRulesets
private
array<string|int, Ruleset>
$singularRulesets
= []
Methods
__construct()
public
final __construct() : mixed
build()
Builds the inflector instance with all applicable rules
public
final build() : Inflector
Return values
InflectorwithPluralRules()
Applies custom rules for pluralisation
public
final withPluralRules(Ruleset|null $pluralRules[, bool $reset = false ]) : $this
Parameters
- $pluralRules : Ruleset|null
- $reset : bool = false
-
If true, will unset default inflections for all new rules
Return values
$thiswithSingularRules()
Applies custom rules for singularisation
public
final withSingularRules(Ruleset|null $singularRules[, bool $reset = false ]) : $this
Parameters
- $singularRules : Ruleset|null
- $reset : bool = false
-
If true, will unset default inflections for all new rules
Return values
$thisgetPluralRuleset()
protected
getPluralRuleset() : Ruleset
Return values
RulesetgetSingularRuleset()
protected
getSingularRuleset() : Ruleset