Argument
in package
Argument tokens shortcuts.
Tags
Table of Contents
- allOf() : LogicalAndToken
- Checks that argument matches all tokens
- any() : AnyValueToken
- Matches any single value.
- approximate() : ApproximateValueToken
- Check that argument is same value when rounding to the given precision.
- cetera() : AnyValuesToken
- Matches all values to the rest of the signature.
- containing() : ArrayEntryToken
- Checks that argument array contains value
- containingString() : StringContainsToken
- exact() : ExactValueToken
- Checks that argument is exact value or object.
- is() : IdenticalValueToken
- Checks that argument is identical value.
- not() : LogicalNotToken
- Checks that argument does not match the value|token.
- size() : ArrayCountToken
- Checks that argument array or countable object has exact number of elements.
- that() : CallbackToken
- Checks that argument matches provided callback.
- type() : TypeToken
- Checks that argument is of specific type or instance of specific class.
- which() : ObjectStateToken
- Checks that argument object has specific state.
- withEntry() : ArrayEntryToken
- Checks that argument array contains (key, value) pair
- withEveryEntry() : ArrayEveryEntryToken
- Checks that arguments array entries all match value
- withKey() : ArrayEntryToken
- Checks that argument array has key
Methods
allOf()
Checks that argument matches all tokens
public
static allOf() : LogicalAndToken
Return values
LogicalAndToken —any()
Matches any single value.
public
static any() : AnyValueToken
Return values
AnyValueToken —approximate()
Check that argument is same value when rounding to the given precision.
public
static approximate(float $value, float $precision) : ApproximateValueToken
Parameters
- $value : float
- $precision : float
Return values
ApproximateValueToken —cetera()
Matches all values to the rest of the signature.
public
static cetera() : AnyValuesToken
Return values
AnyValuesToken —containing()
Checks that argument array contains value
public
static containing(mixed $value) : ArrayEntryToken
Parameters
- $value : mixed
Return values
ArrayEntryToken —containingString()
public
static containingString(string $value) : StringContainsToken
Parameters
- $value : string
Return values
StringContainsToken —exact()
Checks that argument is exact value or object.
public
static exact(mixed $value) : ExactValueToken
Parameters
- $value : mixed
Return values
ExactValueToken —is()
Checks that argument is identical value.
public
static is(mixed $value) : IdenticalValueToken
Parameters
- $value : mixed
Return values
IdenticalValueToken —not()
Checks that argument does not match the value|token.
public
static not(mixed $value) : LogicalNotToken
Parameters
- $value : mixed
-
either exact value or argument token
Return values
LogicalNotToken —size()
Checks that argument array or countable object has exact number of elements.
public
static size(int $value) : ArrayCountToken
Parameters
- $value : int
-
array elements count
Return values
ArrayCountToken —that()
Checks that argument matches provided callback.
public
static that(callable $callback) : CallbackToken
Parameters
- $callback : callable
Return values
CallbackToken —type()
Checks that argument is of specific type or instance of specific class.
public
static type(string $type) : TypeToken
Parameters
- $type : string
-
Type name (
integer
,string
) or full class name
Return values
TypeToken —which()
Checks that argument object has specific state.
public
static which(string $methodName, mixed $value) : ObjectStateToken
Parameters
- $methodName : string
- $value : mixed
Return values
ObjectStateToken —withEntry()
Checks that argument array contains (key, value) pair
public
static withEntry(mixed $key, mixed $value) : ArrayEntryToken
Parameters
- $key : mixed
-
exact value or token
- $value : mixed
-
exact value or token
Return values
ArrayEntryToken —withEveryEntry()
Checks that arguments array entries all match value
public
static withEveryEntry(mixed $value) : ArrayEveryEntryToken
Parameters
- $value : mixed
Return values
ArrayEveryEntryToken —withKey()
Checks that argument array has key
public
static withKey(mixed $key) : ArrayEntryToken
Parameters
- $key : mixed
-
exact value or token