Placeholder
in package
FinalYes
Object used in currying functions to omit some parameter.
For example whe have currying function f accepting two arguments a1, a2.
It's possible to call it like this: f(Placeholder::create(), $someValue)
or even simpler
f(__, $someValue)
. In result new currying function will be returned. That function will
await only one, the first a1 argument.
Table of Contents
Methods
- create() : self
- filterPlaceholders() : array<string|int, mixed>
- Returns new array without placeholders.
- isPlaceholder() : bool
Methods
create()
public
static create() : self
Return values
self —filterPlaceholders()
Returns new array without placeholders.
public
static filterPlaceholders(array<string|int, mixed> $arguments) : array<string|int, mixed>
Parameters
- $arguments : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —isPlaceholder()
public
static isPlaceholder(mixed $argument) : bool
Parameters
- $argument : mixed
Return values
bool —true value whenever $argument is instance of Placeholder or __ constant (or function)