@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected $precidence = 4; |
26 | 26 | |
27 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
27 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
28 | 28 | return $stack->pop()->operate($stack, $variables) + $stack->pop()->operate($stack, $variables); |
29 | 29 | } |
30 | 30 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected $precidence = 5; |
26 | 26 | |
27 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
27 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
28 | 28 | $left = $stack->pop()->operate($stack, $variables); |
29 | 29 | $right = $stack->pop()->operate($stack, $variables); |
30 | 30 | return $right % $left; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected $precidence = 6; |
26 | 26 | |
27 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
27 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function isParenthesis() { |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | class TernaryIntermediate extends \SimpleMath\Expression { |
24 | 24 | |
25 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
25 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
26 | 26 | throw new \RuntimeException('Mismatched ternary operator!'); |
27 | 27 | } |
28 | 28 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected $precidence = 3; |
26 | 26 | |
27 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) |
|
27 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) |
|
28 | 28 | { |
29 | 29 | $right = $stack->pop()->operate($stack, $variables); |
30 | 30 | $left = $stack->pop()->operate($stack, $variables); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | class Number extends \SimpleMath\Expression { |
24 | 24 | |
25 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
25 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
26 | 26 | return $this->value; |
27 | 27 | } |
28 | 28 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected $precidence = 5; |
26 | 26 | |
27 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
27 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
28 | 28 | return $stack->pop()->operate($stack, $variables) * $stack->pop()->operate($stack, $variables); |
29 | 29 | } |
30 | 30 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | class Variable extends \SimpleMath\Expression { |
24 | 24 | |
25 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
25 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
26 | 26 | return isset($variables[$this->value]) ? $variables[$this->value] : 0; |
27 | 27 | } |
28 | 28 |
@@ -25,8 +25,8 @@ |
||
25 | 25 | protected $precidence = 1; |
26 | 26 | protected $leftAssoc = false; |
27 | 27 | |
28 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
29 | - if (! $this->isOpen()) { |
|
28 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
29 | + if (!$this->isOpen()) { |
|
30 | 30 | $right = $stack->pop()->operate($stack, $variables); |
31 | 31 | $left = $stack->pop()->operate($stack, $variables); |
32 | 32 | return new TernaryIntermediate(array($left, $right)); |