1 | <?php |
||
5 | class CyclicReferenceStack |
||
6 | { |
||
7 | /** |
||
8 | * The call stack for calculated cells. |
||
9 | * |
||
10 | * @var mixed[] |
||
11 | */ |
||
12 | private $stack = []; |
||
13 | |||
14 | /** |
||
15 | * Return the number of entries on the stack. |
||
16 | * |
||
17 | * @return int |
||
18 | */ |
||
19 | public function count() |
||
23 | |||
24 | /** |
||
25 | * Push a new entry onto the stack. |
||
26 | * |
||
27 | * @param mixed $value |
||
28 | */ |
||
29 | 117 | public function push($value) |
|
33 | |||
34 | /** |
||
35 | * Pop the last entry from the stack. |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | 117 | public function pop() |
|
43 | |||
44 | /** |
||
45 | * Test to see if a specified entry exists on the stack. |
||
46 | * |
||
47 | * @param mixed $value The value to test |
||
48 | */ |
||
49 | 60 | public function onStack($value) |
|
53 | |||
54 | /** |
||
55 | * Clear the stack. |
||
56 | */ |
||
57 | 47 | public function clear() |
|
61 | |||
62 | /** |
||
63 | * Return an array of all entries on the stack. |
||
64 | * |
||
65 | * @return mixed[] |
||
66 | */ |
||
67 | public function showStack() |
||
71 | } |
||
72 |