Conditionable
Table of Contents
Methods
- unless() : $this|TUnlessReturnType
- Apply the callback if the given "value" is (or resolves to) falsy.
- when() : $this|TWhenReturnType
- Apply the callback if the given "value" is (or resolves to) truthy.
Methods
unless()
Apply the callback if the given "value" is (or resolves to) falsy.
public
unless([callable($this): TUnlessParameter|null $value = null ][, callable($this, TUnlessParameter): TUnlessReturnType|null $callback = null ][, callable($this, TUnlessParameter): TUnlessReturnType|null $default = null ]) : $this|TUnlessReturnType
Parameters
- $value : callable($this): TUnlessParameter|null = null
- $callback : callable($this, TUnlessParameter): TUnlessReturnType|null = null
- $default : callable($this, TUnlessParameter): TUnlessReturnType|null = null
Tags
Return values
$this|TUnlessReturnTypewhen()
Apply the callback if the given "value" is (or resolves to) truthy.
public
when([callable($this): TWhenParameter|null $value = null ][, callable($this, TWhenParameter): TWhenReturnType|null $callback = null ][, callable($this, TWhenParameter): TWhenReturnType|null $default = null ]) : $this|TWhenReturnType
Parameters
- $value : callable($this): TWhenParameter|null = null
- $callback : callable($this, TWhenParameter): TWhenReturnType|null = null
- $default : callable($this, TWhenParameter): TWhenReturnType|null = null