@@ -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 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 |
@@ -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 |
@@ -29,14 +29,14 @@ |
||
29 | 29 | return true; |
30 | 30 | } |
31 | 31 | |
32 | - public function operateTernary(\SimpleMath\Stack $stack, $variables=array()) { |
|
32 | + public function operateTernary(\SimpleMath\Stack $stack, $variables = array()) { |
|
33 | 33 | $right = $stack->pop()->operate($stack, $variables); |
34 | 34 | $left = $stack->pop()->operate($stack, $variables); |
35 | 35 | return array($left, $right); |
36 | 36 | } |
37 | 37 | |
38 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) { |
|
39 | - if (! $this->isOpen()) { |
|
38 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) { |
|
39 | + if (!$this->isOpen()) { |
|
40 | 40 | throw new \RuntimeException('Mismatched ternary operator!'); |
41 | 41 | } else { |
42 | 42 | $right = $stack->pop(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | return true; |
27 | 27 | } |
28 | 28 | |
29 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) |
|
29 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) |
|
30 | 30 | { |
31 | 31 | $right = $stack->pop()->operate($stack, $variables); |
32 | 32 | $left = $stack->pop(); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | abstract class Binary extends Operator { |
24 | 24 | |
25 | - public function operate(\SimpleMath\Stack $stack, $variables=array()) |
|
25 | + public function operate(\SimpleMath\Stack $stack, $variables = array()) |
|
26 | 26 | { |
27 | 27 | return parent::operate($stack, $variables) ? 1 : 0; |
28 | 28 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | throw new \RuntimeException('Undefined Value ' . $value); |
88 | 88 | } |
89 | 89 | |
90 | - abstract public function operate(Stack $stack, $variables=array()); |
|
90 | + abstract public function operate(Stack $stack, $variables = array()); |
|
91 | 91 | |
92 | 92 | public function isOperator() { |
93 | 93 | return false; |