PHP Interface Pinq\IAggregatable

Author: Elliot Levin ([email protected])
Inheritance: extends Countable
Exibir arquivo Open project: timetoogo/pinq

Public Methods

Method Description
aggregate ( callable $function ) : mixed Aggregates the values with the supplied function.
all ( callable $function = null ) : boolean Returns a boolean of if all the values evaluate to true.
any ( callable $function = null ) : boolean Returns a boolean of if any of the values evaluate to true.
average ( callable $function = null ) : integer | double | null Returns the average of the values.
count ( ) : integer Returns the amount of the values.
implode ( string $delimiter, callable $function = null ) : string Returns a string of all the values concatenated by the delimiter.
isEmpty ( ) : boolean Returns whether the traversable contains no elements.
maximum ( callable $function = null ) : mixed Returns the maximum value.
minimum ( callable $function = null ) : mixed Returns the maximum value.
sum ( callable $function = null ) : integer | double | null Returns the sum of the values.

Method Details

aggregate() public method

Aggregates the values with the supplied function.
public aggregate ( callable $function ) : mixed
$function callable The aggregate function, parameters: ($aggregate, $step)
return mixed

all() public method

Returns a boolean of if all the values evaluate to true.
public all ( callable $function = null ) : boolean
$function callable The function which will return the values.
return boolean

any() public method

Returns a boolean of if any of the values evaluate to true.
public any ( callable $function = null ) : boolean
$function callable The function which will return the values.
return boolean

average() public method

Returns the average of the values.
public average ( callable $function = null ) : integer | double | null
$function callable The function which will return the values.
return integer | double | null

count() public method

Returns the amount of the values.
public count ( ) : integer
return integer

implode() public method

Returns a string of all the values concatenated by the delimiter.
public implode ( string $delimiter, callable $function = null ) : string
$delimiter string The string to delimit the values by.
$function callable The function which will return the values.
return string

isEmpty() public method

Returns whether the traversable contains no elements.
public isEmpty ( ) : boolean
return boolean

maximum() public method

Returns the maximum value.
public maximum ( callable $function = null ) : mixed
$function callable The function which will return the values.
return mixed

minimum() public method

Returns the maximum value.
public minimum ( callable $function = null ) : mixed
$function callable The function which will return the values.
return mixed

sum() public method

Returns the sum of the values.
public sum ( callable $function = null ) : integer | double | null
$function callable The function which will return the values.
return integer | double | null