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