Documentation

Scope
in package

Tags
author

Jean-François Simon jeanfrancois.simon@sensiolabs.com

Table of Contents

Properties

$data  : array<string|int, mixed>
$left  : bool
$parent  : self|null

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
self

get()

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
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(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Tags
throws
LogicException
Return values
$this

        
On this page

Search results