Scope
in package
Table of Contents
- $data : mixed
- $left : mixed
- $parent : mixed
- __construct() : mixed
- enter() : self
- Opens a new child scope.
- get() : mixed
- Returns data visible from current scope.
- has() : bool
- Tests if a data is visible from current scope.
- leave() : self|null
- Closes current scope and returns parent one.
- set() : $this
- Stores data into current scope.
Properties
$data
private
mixed
$data
= []
$left
private
mixed
$left
= false
$parent
private
mixed
$parent
Methods
__construct()
public
__construct([self|null $parent = null ]) : mixed
Parameters
- $parent : self|null = null
Return values
mixed —enter()
Opens a new child scope.
public
enter() : self
Return values
self —get()
Returns data visible from current scope.
public
get(mixed $key[, mixed|null $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed|null = null
Tags
Return values
mixed —has()
Tests if a data is visible from current scope.
public
has(mixed $key) : bool
Parameters
- $key : mixed
Tags
Return values
bool —leave()
Closes current scope and returns parent one.
public
leave() : self|null
Return values
self|null —set()
Stores data into current scope.
public
set(mixed $key, mixed $value) : $this
Parameters
- $key : mixed
- $value : mixed