Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5983550
TemplateModeStack.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
985 B
Referenced Files
None
Subscribers
None
TemplateModeStack.php
View Options
<?php
namespace
Wikimedia\RemexHtml\TreeBuilder
;
/**
* The stack of template insertion modes. We use a storage model optimised for
* access to the element at the top of the stack, which is stored separately
* from the rest of the stack.
*/
class
TemplateModeStack
{
/**
* The insertion mode at the top of the stack. This is public for
* performance reasons but should be treated as read-only.
* @var int|null
*/
public
$current
;
/**
* The remainder of the stack
*
* @var array
*/
private
$nonCurrentModes
=
[];
/**
* Push a mode on to the stack
* @param int $mode
*/
public
function
push
(
$mode
)
{
$this
->
nonCurrentModes
[]
=
$this
->
current
;
$this
->
current
=
$mode
;
}
/**
* Pop a mode from the stack
*/
public
function
pop
()
{
$this
->
current
=
array_pop
(
$this
->
nonCurrentModes
);
}
/**
* Return true if the stack is empty, false otherwise
* @return bool
*/
public
function
isEmpty
()
{
return
$this
->
current
===
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 22:55 (1 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
36/f3/885d78c63136c4a47c2980f78e37
Default Alt Text
TemplateModeStack.php (985 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment