Auth0-PHP

Toolkit
in package

FinalYes

A convenience class wrapping various helper methods.

Table of Contents

Methods

assert()  : Assert
Convenience methods for asserting the content of values.
each()  : void
Pass each item in an iterable through a function.
every()  : bool
Throw an $exception or return false if any of the provided values are null.
filter()  : Filter
Convenience methods for filtering the content of values.
merge()  : array<string|int, mixed>
Progressively merge one or more arrays, overwriting values from left to right. Null values is discarded.
some()  : array<string|int, mixed>|false
Throw an $exception or return false if all the provided values are null.
times()  : void
Run a function a certain number of times.

Methods

assert()

Convenience methods for asserting the content of values.

public static assert(array<string|int, Throwable}$subjects) : Assert
Parameters
$subjects : array<string|int, Throwable}>

an array of values to work with

Return values
Assert

each()

Pass each item in an iterable through a function.

public static each(iterable<string|int, mixed> &$items, Closure $callback) : void
Parameters
$items : iterable<string|int, mixed>

the iterable to process

$callback : Closure

the function to pass each item through

every()

Throw an $exception or return false if any of the provided values are null.

public static every(null|Throwable $exception, array<string|int, mixed> $values) : bool
Parameters
$exception : null|Throwable

an exception to throw if all values are null

$values : array<string|int, mixed>

one or more values to check

Tags
throws
Throwable

if there are no non-null values

Return values
bool

filter()

Convenience methods for filtering the content of values.

public static filter(array<string|int, mixed> $subjects) : Filter
Parameters
$subjects : array<string|int, mixed>

an array of values to work with

Return values
Filter

merge()

Progressively merge one or more arrays, overwriting values from left to right. Null values is discarded.

public static merge([array<string|int, mixed> $arrays = [] ]) : array<string|int, mixed>
Parameters
$arrays : array<string|int, mixed> = []

one or more arrays to merge

Tags
codeCoverageIgnore
Return values
array<string|int, mixed>

some()

Throw an $exception or return false if all the provided values are null.

public static some(null|Throwable $exception, array<string|int, mixed> $values) : array<string|int, mixed>|false
Parameters
$exception : null|Throwable

an exception to throw if all values are null

$values : array<string|int, mixed>

one or more values to check

Tags
throws
Throwable

if there are no non-null values

Return values
array<string|int, mixed>|false

times()

Run a function a certain number of times.

public static times(int $times, Closure $callback) : void
Parameters
$times : int

the number of times to run $callback

$callback : Closure

the function to run

On this page

Search results