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' );
*/
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 );
}
}
continue;
} else {
// Operator
- if ( !$expectOperator ) {
+ if ( !$expectOperator ) {
$token->error( 'unexpected operator' );
}
// Resolve higher precedence levels
// 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 = '';