1 | <?php |
||
8 | class ValueResult implements \ArrayAccess { |
||
9 | private $result = []; |
||
10 | |||
11 | /* |
||
12 | The next operation to perform. Will be one of the following: |
||
13 | ARG - A new value e.g, "a","b" becomes ["a", "b"] |
||
14 | CONCAT - Concat onto the current arg e.g "a" + "b" becomes ["ab"] |
||
15 | NOT - Boolean operation "a" != "b" becomes [true] |
||
16 | EQUALS - Boolean operation "a" = "b" becomes [false] |
||
17 | */ |
||
18 | private $mode = Tokenizer::ARG; |
||
19 | |||
20 | //Processes $newValue using $mode. Either concats to the current argument, adds a new argument |
||
21 | //Or usess the two arguments for a boolean comparison |
||
22 | public function processValue($newValue) { |
||
38 | |||
39 | public function arg($value) { |
||
42 | |||
43 | public function concat($value) { |
||
46 | |||
47 | public function not($value) { |
||
50 | |||
51 | public function equals($value) { |
||
54 | |||
55 | public function add($value) { |
||
58 | |||
59 | public function sub($value) { |
||
62 | |||
63 | public function mult($value) { |
||
66 | |||
67 | public function div($value) { |
||
70 | |||
71 | public function setMode($mode) { |
||
74 | |||
75 | public function getMode() { |
||
78 | |||
79 | public function getResult() { |
||
82 | |||
83 | public function pop() { |
||
86 | |||
87 | public function offsetSet($key, $value) { |
||
90 | |||
91 | public function offsetGet($key) { |
||
94 | |||
95 | public function offsetUnset($key) { |
||
98 | |||
99 | public function offsetExists($key) { |
||
102 | |||
103 | public function clear() { |
||
106 | } |
||
107 |