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) { |
||
32 | |||
33 | public function arg($value) { |
||
36 | |||
37 | public function concat($value) { |
||
40 | |||
41 | public function not($value) { |
||
44 | |||
45 | public function equals($value) { |
||
48 | |||
49 | |||
50 | public function setMode($mode) { |
||
53 | |||
54 | public function getMode() { |
||
57 | |||
58 | public function getResult() { |
||
61 | |||
62 | public function pop() { |
||
65 | |||
66 | public function offsetSet($key, $value) { |
||
69 | |||
70 | public function offsetGet($key) { |
||
73 | |||
74 | public function offsetUnset($key) { |
||
77 | |||
78 | public function offsetExists($key) { |
||
81 | |||
82 | public function clear() { |
||
85 | } |