Mercurial > hg > isophonics-drupal-site
annotate core/modules/locale/src/PluralFormulaInterface.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\locale; |
Chris@0 | 4 |
Chris@0 | 5 /** |
Chris@0 | 6 * An interface for a service providing plural formulae. |
Chris@0 | 7 */ |
Chris@0 | 8 interface PluralFormulaInterface { |
Chris@0 | 9 |
Chris@0 | 10 /** |
Chris@0 | 11 * @param string $langcode |
Chris@0 | 12 * The language code to get the formula for. |
Chris@0 | 13 * @param int $plural_count |
Chris@0 | 14 * The number of plural forms. |
Chris@0 | 15 * @param array $formula |
Chris@0 | 16 * An array of formulae. |
Chris@0 | 17 * |
Chris@0 | 18 * @return self |
Chris@0 | 19 * The PluralFormula object. |
Chris@0 | 20 */ |
Chris@0 | 21 public function setPluralFormula($langcode, $plural_count, array $formula); |
Chris@0 | 22 |
Chris@0 | 23 /** |
Chris@0 | 24 * Returns the number of plurals supported by a given language. |
Chris@0 | 25 * |
Chris@0 | 26 * @param null|string $langcode |
Chris@0 | 27 * (optional) The language code. If not provided, the current language |
Chris@0 | 28 * will be used. |
Chris@0 | 29 * |
Chris@0 | 30 * @return int |
Chris@0 | 31 * Number of plural variants supported by the given language. |
Chris@0 | 32 */ |
Chris@0 | 33 public function getNumberOfPlurals($langcode = NULL); |
Chris@0 | 34 |
Chris@0 | 35 /** |
Chris@0 | 36 * Gets the plural formula for a langcode. |
Chris@0 | 37 * |
Chris@0 | 38 * @param string $langcode |
Chris@0 | 39 * The language code to get the formula for. |
Chris@0 | 40 * |
Chris@0 | 41 * @return array |
Chris@0 | 42 * An array of formulae. |
Chris@0 | 43 */ |
Chris@0 | 44 public function getFormula($langcode); |
Chris@0 | 45 |
Chris@0 | 46 /** |
Chris@0 | 47 * Resets the static formulae cache. |
Chris@0 | 48 * |
Chris@0 | 49 * @return self |
Chris@0 | 50 * The PluralFormula object. |
Chris@0 | 51 */ |
Chris@0 | 52 public function reset(); |
Chris@0 | 53 |
Chris@0 | 54 } |