Documentation

ContextStack
in package

Table of Contents

$elements  : array<string|int, mixed>
$project  : Project
$typeContext  : Context|null
__construct()  : mixed
getProject()  : Project
getTypeContext()  : Context|null
peek()  : Element|File
push()  : self
search()  : Element|File|null
Returns the first element of type.
withTypeContext()  : ContextStack
createFromSelf()  : self

Properties

$elements

private array<string|int, mixed> $elements = []

Methods

Returns the first element of type.

public search(class-string $type) : Element|File|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|null

createFromSelf()

private static createFromSelf(Project $project, Context|null $typeContext, array<string|int, \phpDocumentor\Reflection\Element|\phpDocumentor\Reflection\Php\File> $elements) : self
Parameters
$project : Project
$typeContext : Context|null
$elements : array<string|int, \phpDocumentor\Reflection\Element|\phpDocumentor\Reflection\Php\File>
Return values
self

Search results