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

Which function body the analyzer is currently walking.

Constants§

public const MAIN = '{main}'

The name used for statements issued outside any function.

Properties§

public string $file
public string $function = self::MAIN
public string|null $className = null
public list<string> $stack = []

Methods§

public function __construct(
    public string $file,
    public string $function = self::MAIN,
    public string|null $className = null,
    public list<string> $stack = [],
)

Parameters

$filestringThe file being analyzed, relative to the analysis root
$functionstringThe enclosing function, as `Class::method`, `function` or `{main}`
$classNamestring|nullThe class the body belongs to, when it belongs to one
$stacklist<string>The path from the body the walk started in to the one it is in, innermost last
Calls 1
public function enter(string $function, string|null $className, string $file): self
public function depth(): int

How many calls deep the analyzer currently is, counting from the body it started in.

Returns

int
Test cases 2
Called from 1
Calls 2
public function isFollowing(string $function): bool

Whether the named function is already being followed, which would recurse.

Parameters

$functionstring

Returns

bool
Called from 2
Calls 1

Test cases 194§

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

Dedicated tests 6
Other tests reaching this symbol 188

Relations§

Instantiated in 4
Method calls 5
Constant reads 4
Type declarations 58