Documentation

Argument
in package

Argument tokens shortcuts.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

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.
in()  : InArrayToken
Checks that argument is in array.
is()  : IdenticalValueToken
Checks that argument is identical value.
not()  : LogicalNotToken
Checks that argument does not match the value|token.
notIn()  : NotInArrayToken
Checks that argument is not in array.
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

approximate()

Check that argument is same value when rounding to the given precision.

public static approximate(float $value[, float $precision = 0 ]) : ApproximateValueToken
Parameters
$value : float
$precision : float = 0
Return values
ApproximateValueToken

in()

Checks that argument is in array.

public static in(array<string|int, mixed> $value) : InArrayToken
Parameters
$value : array<string|int, mixed>
Return values
InArrayToken

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

notIn()

Checks that argument is not in array.

public static notIn(array<string|int, mixed> $value) : NotInArrayToken
Parameters
$value : array<string|int, mixed>
Return values
NotInArrayToken

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

Search results