PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.10.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.10.8
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Calculation / Engine / CyclicReferenceStack.php

CyclicReferenceStack.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.10.8, at vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php

74 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Calculation\Engine;
4
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()
20 {
21 return count($this->stack);
22 }
23
24 /**
25 * Push a new entry onto the stack.
26 *
27 * @param mixed $value
28 */
29 public function push($value)
30 {
31 $this->stack[$value] = $value;
32 }
33
34 /**
35 * Pop the last entry from the stack.
36 *
37 * @return mixed
38 */
39 public function pop()
40 {
41 return array_pop($this->stack);
42 }
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 * @return bool
50 */
51 public function onStack($value)
52 {
53 return isset($this->stack[$value]);
54 }
55
56 /**
57 * Clear the stack.
58 */
59 public function clear()
60 {
61 $this->stack = [];
62 }
63
64 /**
65 * Return an array of all entries on the stack.
66 *
67 * @return mixed[]
68 */
69 public function showStack()
70 {
71 return $this->stack;
72 }
73 }
74