ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
ContextStack.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\ScreenContext\Stack
;
22
23
use
ILIAS\GlobalScreen\ScreenContext\ScreenContext
;
24
use LogicException;
25
30
class
ContextStack
31
{
35
protected
array
$stack
= [];
36
40
public
function
push
(
ScreenContext
$context
): void
41
{
42
if
(in_array(
$context
, $this->stack)) {
43
throw
new
LogicException(
"A context can only be claimed once"
);
44
}
45
$this->stack[] =
$context
;
46
}
47
51
public
function
getLast
():
ScreenContext
52
{
53
return
end($this->stack);
54
}
55
59
public
function
getStack
(): array
60
{
61
return
$this->stack
;
62
}
63
67
public
function
getStackAsArray
(): array
68
{
69
$return = [];
70
foreach
($this->stack as $item) {
71
$return[] = $item->getUniqueContextIdentifier();
72
}
73
74
return
$return;
75
}
76
}
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack
Class ContextStack.
Definition:
ContextStack.php:31
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getStack
getStack()
Definition:
ContextStack.php:59
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getLast
getLast()
Definition:
ContextStack.php:51
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\getStackAsArray
getStackAsArray()
Definition:
ContextStack.php:67
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\$stack
array $stack
Definition:
ContextStack.php:35
ILIAS\GlobalScreen\ScreenContext\Stack\ContextStack\push
push(ScreenContext $context)
Definition:
ContextStack.php:40
ILIAS\GlobalScreen\ScreenContext\ScreenContext
Interface ScreenContext.
Definition:
ScreenContext.php:31
ILIAS\GlobalScreen\ScreenContext\Stack
Definition:
CalledContexts.php:21
$context
$context
Definition:
webdav.php:31
components
ILIAS
GlobalScreen
src
ScreenContext
Stack
ContextStack.php
Generated on Sun Oct 19 2025 23:03:00 for ILIAS by
1.9.4 (using
Doxyfile
)