Optional
in package
implements
ArrayAccess
Uses
Macroable
Interfaces, Classes and Traits
- ArrayAccess
Table of Contents
- $macros : array<string|int, mixed>
- The registered string macros.
- $value : mixed
- The underlying object.
- __call() : mixed
- Dynamically pass a method to the underlying object.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : void
- Create a new optional instance.
- __get() : mixed
- Dynamically access a property on the underlying object.
- hasMacro() : bool
- Checks if macro is registered.
- macro() : void
- Register a custom macro.
- mixin() : void
- Mix another object into the class.
- offsetExists() : bool
- Determine if an item exists at an offset.
- offsetGet() : mixed
- Get an item at a given offset.
- offsetSet() : void
- Set the item at a given offset.
- offsetUnset() : void
- Unset the item at a given offset.
Properties
$macros
The registered string macros.
protected
static array<string|int, mixed>
$macros
= []
$value
The underlying object.
protected
mixed
$value
Methods
__call()
Dynamically pass a method to the underlying object.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__construct()
Create a new optional instance.
public
__construct(mixed $value) : void
Parameters
- $value : mixed
Return values
void —__get()
Dynamically access a property on the underlying object.
public
__get(string $key) : mixed
Parameters
- $key : string
Return values
mixed —hasMacro()
Checks if macro is registered.
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
bool —macro()
Register a custom macro.
public
static macro(string $name, object|callable $macro) : void
Parameters
- $name : string
- $macro : object|callable
Return values
void —mixin()
Mix another object into the class.
public
static mixin(object $mixin) : void
Parameters
- $mixin : object
Return values
void —offsetExists()
Determine if an item exists at an offset.
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —offsetGet()
Get an item at a given offset.
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —offsetSet()
Set the item at a given offset.
public
offsetSet(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
Return values
void —offsetUnset()
Unset the item at a given offset.
public
offsetUnset(string $key) : void
Parameters
- $key : string