PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / Engine / CyclicReferenceStack.php

CyclicReferenceStack.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php

69 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\Engine;
4
5 class CyclicReferenceStack
6 {
7 /**
8 * The call stack for calculated cells.
9 *
10 * @var mixed[]
11 */
12 private array $stack = [];
13
14 /**
15 * Return the number of entries on the stack.
16 */
17 public function count(): int
18 {
19 return count($this->stack);
20 }
21
22 /**
23 * Push a new entry onto the stack.
24 *
25 * @param int|string $value The value to test
26 */
27 public function push($value): void
28 {
29 $this->stack[$value] = $value;
30 }
31
32 /**
33 * Pop the last entry from the stack.
34 * @return mixed
35 */
36 public function pop()
37 {
38 return array_pop($this->stack);
39 }
40
41 /**
42 * Test to see if a specified entry exists on the stack.
43 *
44 * @param int|string $value The value to test
45 */
46 public function onStack($value): bool
47 {
48 return isset($this->stack[$value]);
49 }
50
51 /**
52 * Clear the stack.
53 */
54 public function clear(): void
55 {
56 $this->stack = [];
57 }
58
59 /**
60 * Return an array of all entries on the stack.
61 *
62 * @return mixed[]
63 */
64 public function showStack(): array
65 {
66 return $this->stack;
67 }
68 }
69