Merge "ForeignAPIRepo: Fetch thumb error from foreign repo"
[lhc/web/wiklou.git] / languages / utils / CLDRPluralRuleEvaluator.php
index be2b8c3..43e8aaf 100644 (file)
@@ -7,7 +7,25 @@
  * @author Niklas Laxstrom, Tim Starling
  *
  * @copyright Copyright © 2010-2012, Niklas Laxström
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0
+ * or later
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ *
  * @file
  * @since 1.20
  */
@@ -49,7 +67,7 @@ class CLDRPluralRuleEvaluator {
        public static function evaluateCompiled( $number, array $rules ) {
                // The compiled form is RPN, with tokens strictly delimited by
                // spaces, so this is a simple RPN evaluator.
-               foreach ( $rules as $i => $rule  ) {
+               foreach ( $rules as $i => $rule ) {
                        $stack = array();
                        $zero = ord( '0' );
                        $nine = ord( '9' );
@@ -86,7 +104,7 @@ class CLDRPluralRuleEvaluator {
         */
        private static function doOperation( $token, $left, $right ) {
                if ( in_array( $token, array( 'in', 'not-in', 'within', 'not-within' ) ) ) {
-                       if ( !($right instanceof CLDRPluralRuleEvaluator_Range ) ) {
+                       if ( !( $right instanceof CLDRPluralRuleEvaluator_Range ) ) {
                                $right = new CLDRPluralRuleEvaluator_Range( $right );
                        }
                }
@@ -287,7 +305,7 @@ class CLDRPluralRuleConverter {
                                continue;
                        } else {
                                // Operator
-                               if  ( !$expectOperator ) {
+                               if ( !$expectOperator ) {
                                        $token->error( 'unexpected operator' );
                                }
                                // Resolve higher precedence levels
@@ -363,7 +381,7 @@ class CLDRPluralRuleConverter {
 
                // Word
                if ( !preg_match( self::WORD_REGEX, $this->rule, $m, 0, $this->pos ) ) {
-                       $this->error( 'unexpected character "' . $this->rule[$this->pos] . '"'  );
+                       $this->error( 'unexpected character "' . $this->rule[$this->pos] . '"' );
                }
                $word1 = strtolower( $m[0] );
                $word2 = '';