Guides

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

$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

getTypeContext()

public getTypeContext() : Context|null
Return values
Context|null

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|null

createFromSelf()

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>
Return values
self

        
On this page

Search results