\PHPSandboxSandboxedString

Sandboxed string class for PHP Sandboxes.

This class wraps sandboxed strings to intercept and check callable invocations

Summary

Methods
Properties
Constants
__construct()
__toString()
__invoke()
offsetSet()
offsetGet()
offsetExists()
offsetUnset()
getIterator()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$value
$sandbox
N/A

Properties

$value

$value : string

Type

string

Methods

__construct()

__construct(string  $value, \PHPSandbox\PHPSandbox  $sandbox) 

Constructs the SandboxedString

Parameters

string $value

Original string value

\PHPSandbox\PHPSandbox $sandbox

The current sandbox instance to test against

__toString()

__toString() : string

Returns the original string value

Returns

string

__invoke()

__invoke() : mixed|null

Checks the string value against the sandbox function whitelists and blacklists for callback violations

Returns

mixed|null

offsetSet()

offsetSet(mixed  $offset, mixed  $value) 

Set string value at specified offset

Parameters

mixed $offset

Offset to set value

mixed $value

Value to set

offsetGet()

offsetGet(mixed  $offset) : string

Get string value at specified offset

Parameters

mixed $offset

Offset to get value

Returns

string —

Value to return

offsetExists()

offsetExists(mixed  $offset) : boolean

Check if specified offset exists in string value

Parameters

mixed $offset

Offset to check

Returns

boolean —

Return true if offset exists, false otherwise

offsetUnset()

offsetUnset(mixed  $offset) 

Unset string value at specified offset

Parameters

mixed $offset

Offset to unset

getIterator()

getIterator() : \ArrayIterator

Return iterator for string value

Returns

\ArrayIterator —

Array iterator to return