comparison core/lib/Drupal/Component/Gettext/PoHeader.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
186 * @return 186 * @return
187 * An indexed array of parsed plural formula data. Containing: 187 * An indexed array of parsed plural formula data. Containing:
188 * - 'nplurals': The number of plural forms defined by the plural formula. 188 * - 'nplurals': The number of plural forms defined by the plural formula.
189 * - 'plurals': Array of plural positions keyed by plural value. 189 * - 'plurals': Array of plural positions keyed by plural value.
190 * 190 *
191 * @throws Exception 191 * @throws \Exception
192 */ 192 */
193 public function parsePluralForms($pluralforms) { 193 public function parsePluralForms($pluralforms) {
194 $plurals = []; 194 $plurals = [];
195 // First, delete all whitespace. 195 // First, delete all whitespace.
196 $pluralforms = strtr($pluralforms, [" " => "", "\t" => ""]); 196 $pluralforms = strtr($pluralforms, [" " => "", "\t" => ""]);
471 * 471 *
472 * @return int 472 * @return int
473 * Number of the plural string to be used for the given plural value. 473 * Number of the plural string to be used for the given plural value.
474 * 474 *
475 * @see parseArithmetic() 475 * @see parseArithmetic()
476 * @throws Exception 476 * @throws \Exception
477 */ 477 */
478 protected function evaluatePlural($element_stack, $n) { 478 protected function evaluatePlural($element_stack, $n) {
479 $count = count($element_stack); 479 $count = count($element_stack);
480 $limit = $count; 480 $limit = $count;
481 // Replace the '$n' value in the formula by the plural value. 481 // Replace the '$n' value in the formula by the plural value.