ContextStack
in package
FinalYes
Table of Contents
Properties
- $elements : array<string|int, Element|File|PropertyHook>
- $project : Project
- $typeContext : Context|null
Methods
- __construct() : mixed
- getProject() : Project
- getTypeContext() : Context|null
- peek() : Element|File|PropertyHook
- push() : self
- search() : Element|File|PropertyHook|null
- Returns the first element of type.
- withTypeContext() : ContextStack
- createFromSelf() : self
Properties
$elements
private
array<string|int, Element|File|PropertyHook>
$elements
= []
$project read-only
private
Project
$project
$typeContext read-only
private
Context|null
$typeContext
= null
Methods
__construct()
public
__construct(Project $project[, Context|null $typeContext = null ]) : mixed
Parameters
- $project : Project
- $typeContext : Context|null = null
getProject()
public
getProject() : Project
Return values
ProjectgetTypeContext()
public
getTypeContext() : Context|null
Return values
Context|nullpeek()
public
peek() : Element|File|PropertyHook
Return values
Element|File|PropertyHookpush()
public
push(Element|File|PropertyHook $element) : self
Parameters
- $element : Element|File|PropertyHook
Return values
selfsearch()
Returns the first element of type.
public
search(class-string $type) : Element|File|PropertyHook|null
Will reverse search the stack for an element matching $type. Will return null when the element type is not in the current stack.
Parameters
- $type : class-string
Return values
Element|File|PropertyHook|nullwithTypeContext()
public
withTypeContext(Context $typeContext) : ContextStack
Parameters
- $typeContext : Context
Return values
ContextStackcreateFromSelf()
private
static createFromSelf(Project $project, Context|null $typeContext, array<string|int, Element|File|PropertyHook> $elements) : self
Parameters
- $project : Project
- $typeContext : Context|null
- $elements : array<string|int, Element|File|PropertyHook>