ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
Stack.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\components\DataCollection\Fields\Formula\FormulaParser
;
22
23
class
Stack
24
{
25
protected
array
$stack
= [];
26
30
public
function
push
($elem): void
31
{
32
$this->stack[] = $elem;
33
}
34
38
public
function
pop
()
39
{
40
if
(!$this->
isEmpty
()) {
41
$last_index =
count
($this->stack) - 1;
42
$elem = $this->stack[$last_index];
43
unset($this->stack[$last_index]);
44
$this->stack = array_values($this->stack);
// re-index
45
46
return
$elem;
47
}
48
49
return
null
;
50
}
51
55
public
function
top
()
56
{
57
if
(!$this->
isEmpty
()) {
58
return
$this->stack[
count
($this->stack) - 1];
59
}
60
61
return
null
;
62
}
63
64
public
function
isEmpty
(): bool
65
{
66
return
!(bool)
count
($this->stack);
67
}
68
69
public
function
reset
(): void
70
{
71
$this->stack = [];
72
}
73
74
public
function
count
():
int
75
{
76
return
count
($this->stack);
77
}
78
}
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\push
push($elem)
Definition:
Stack.php:30
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\pop
pop()
Definition:
Stack.php:38
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\isEmpty
isEmpty()
Definition:
Stack.php:64
ILIAS\components\DataCollection\Fields\Formula\FormulaParser
Definition:
ExpressionParser.php:21
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\$stack
array $stack
Definition:
Stack.php:25
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\reset
reset()
Definition:
Stack.php:69
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack
Definition:
Stack.php:23
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\top
top()
Definition:
Stack.php:55
ILIAS\components\DataCollection\Fields\Formula\FormulaParser\Stack\count
count()
Definition:
Stack.php:74
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
components
ILIAS
DataCollection
classes
Fields
Formula
FormulaParser
Stack.php
Generated on Mon Sep 1 2025 23:02:56 for ILIAS by
1.8.13 (using
Doxyfile
)