diff options
Diffstat (limited to 'src/NXP/Classes')
-rw-r--r-- | src/NXP/Classes/Calculator.php | 4 | ||||
-rw-r--r-- | src/NXP/Classes/CustomFunction.php | 5 | ||||
-rw-r--r-- | src/NXP/Classes/Operator.php | 3 | ||||
-rw-r--r-- | src/NXP/Classes/Tokenizer.php | 2 |
4 files changed, 5 insertions, 9 deletions
diff --git a/src/NXP/Classes/Calculator.php b/src/NXP/Classes/Calculator.php index c6ccff1..94c6933 100644 --- a/src/NXP/Classes/Calculator.php +++ b/src/NXP/Classes/Calculator.php @@ -56,14 +56,14 @@ class Calculator foreach ($tokens as $token) { if ($token->type === Token::Literal || $token->type === Token::String) { $stack[] = $token; - } else if ($token->type === Token::Variable) { + } elseif ($token->type === Token::Variable) { $variable = $token->value; if (!array_key_exists($variable, $variables)) { throw new UnknownVariableException($variable); } $value = $variables[$variable]; $stack[] = new Token(Token::Literal, $value); - } else if ($token->type === Token::Function) { + } elseif ($token->type === Token::Function) { if (!array_key_exists($token->value, $this->functions)) { throw new UnknownFunctionException($token->value); } diff --git a/src/NXP/Classes/CustomFunction.php b/src/NXP/Classes/CustomFunction.php index bf36405..06e21ef 100644 --- a/src/NXP/Classes/CustomFunction.php +++ b/src/NXP/Classes/CustomFunction.php @@ -3,7 +3,6 @@ namespace NXP\Classes; - use NXP\Exception\IncorrectExpressionException; use ReflectionException; use ReflectionFunction; @@ -58,6 +57,4 @@ class CustomFunction return new Token(Token::Literal, $result); } - - -}
\ No newline at end of file +} diff --git a/src/NXP/Classes/Operator.php b/src/NXP/Classes/Operator.php index c3762ea..86df549 100644 --- a/src/NXP/Classes/Operator.php +++ b/src/NXP/Classes/Operator.php @@ -3,7 +3,6 @@ namespace NXP\Classes; - use NXP\Exception\IncorrectExpressionException; use ReflectionFunction; @@ -66,4 +65,4 @@ class Operator return new Token(Token::Literal, $result); } -}
\ No newline at end of file +} diff --git a/src/NXP/Classes/Tokenizer.php b/src/NXP/Classes/Tokenizer.php index caf395f..6b14677 100644 --- a/src/NXP/Classes/Tokenizer.php +++ b/src/NXP/Classes/Tokenizer.php @@ -106,6 +106,7 @@ class Tokenizer $this->allowNegative = true; break; } + // no break case $this->isAlpha($ch): if ($this->numberBuffer != "") { $this->emptyNumberBufferAsLiteral(); @@ -299,4 +300,3 @@ class Tokenizer return $tokens; } } - |