Punic APIs
  • Namespace
  • Class
  • Tree
  • Todo

Namespaces

  • Punic
    • Exception

Classes

  • Calendar
  • Comparer
  • Currency
  • Data
  • Language
  • Misc
  • Number
  • Phone
  • Plural
  • Territory
  • Unit

Exceptions

  • Exception

Class Plural

Plural helper stuff.

Namespace: Punic
Located at Plural.php

Methods summary

public static array<string>
# getRules( string $locale = '' )

Return the list of applicable plural rule for a locale.

Return the list of applicable plural rule for a locale.

Parameters

$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

array<string>
Returns a list containing some the following values: 'zero', 'one', 'two', 'few', 'many', 'other' ('other' will be always there)
public static string
# getRule( string|integer|float $number, string $locale = '' )

Return the plural rule ('zero', 'one', 'two', 'few', 'many' or 'other') for a number and a locale.

Return the plural rule ('zero', 'one', 'two', 'few', 'many' or 'other') for a number and a locale.

Parameters

$number
The number to check the plural rule for for
$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

string
Returns one of the following values: 'zero', 'one', 'two', 'few', 'many', 'other'

Throws

Punic\Exception\BadArgumentType
Throws a \Punic\Exception\BadArgumentType if $number is not a valid number
Exception
Throws a \Exception if there were problems calculating the plural rule
Punic APIs API documentation generated by ApiGen