final class Scope
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Where in the program a statement is issued, read out of the enclosing function's name.

The catalog writes the enclosing function as Class::method, function or {main}. The report needs the pieces: the namespace to group by, the class to write a page for, and the member to head a section with. Reading them once here is what keeps every page addressing the same code the same way.

Constants§

public const MAIN = '{main}'

The name the catalog gives to code outside any function.

Properties§

public string $namespace
public string|null $class
public string $member

Methods§

public function __construct(
    public string $namespace,
    public string|null $class,
    public string $member,
)

Parameters

$namespacestringThe namespace, empty for the global one
$classstring|nullThe fully qualified class, or null outside a class
$memberstringThe method, function or `{main}`
public static function of(string $function): self

The scope an enclosing function's name stands for.

Parameters

$functionstring

Returns

self
Test cases 7
Called from 25
Calls 5
public function isMain(): bool

Whether the statement is issued outside any function.

Returns

bool
Called from 1
Calls 1
public function isMethod(): bool

Whether the statement is issued from a method.

Returns

bool
public function classShort(): ?string

The class without its namespace, or null outside a class.

Returns

?string
Called from 1
Calls 2
public function function(): string

The function written the way the catalog writes it.

Returns

string
public function display(): string

The function written for a reader, without the namespace.

Returns

string
Calls 2
public function namespaceLabel(): string

The namespace written for a reader.

Returns

string

Test cases 26§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7
Other tests reaching this symbol 19

Relations§

Static calls 25