PHP Interface phpstreams\Collector

A collector can be thought of as a stateful reductor. It is initialized (in some way) and then elements are insterted one by one. Finally, the result is queried in the get method.
Author: Bert Peters ([email protected])
ファイルを表示 Open project: bertptrs/phpstreams Interface Usage Examples

Public Methods

Method Description
add ( mixed $key, mixed $value ) Add a new value to the collector.
get ( ) : mixed Get the final result from the collector.

Method Details

add() public method

Add a new value to the collector.
public add ( mixed $key, mixed $value )
$key mixed The current key.
$value mixed The current value.

get() public method

Get the final result from the collector.
public get ( ) : mixed
return mixed Whatever the result of this collector is.