\dooaki\Container\LazyEnumerator

make Enumerable object from callable returns array or Traversable

Summary

Methods
Properties
Constants
select()
findAll()
map()
mapKey()
mapKeyValue()
skip()
offset()
take()
limit()
tap()
transpose()
flatten()
first()
last()
any()
all()
apply()
toArray()
toArrayValues()
__construct()
each()
from()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_toArray()
_toArrayValues()
isIterable()
$each
N/A

Properties

$each

$each : 

Type

Methods

select()

select(callable  $predicate) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which $predicate returns a true value

Parameters

callable $predicate

Returns

\dooaki\Container\Lazy\Enumerator

findAll()

findAll(callable  $predicate) : \dooaki\Container\Lazy\Enumerator

Same as select method

Parameters

callable $predicate

Returns

\dooaki\Container\Lazy\Enumerator

map()

map(callable  $converter) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which convert values

Parameters

callable $converter

Returns

\dooaki\Container\Lazy\Enumerator

mapKey()

mapKey(callable  $converter) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which convert keys

Parameters

callable $converter

Returns

\dooaki\Container\Lazy\Enumerator

mapKeyValue()

mapKeyValue(callable  $converter) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which convert keys and values

Parameters

callable $converter

Returns

\dooaki\Container\Lazy\Enumerator

skip()

skip(\dooaki\Container\Lazy\unknown  $n) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which first $n elements

Parameters

\dooaki\Container\Lazy\unknown $n

Returns

\dooaki\Container\Lazy\Enumerator

take()

take(integer  $n) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which first $n elements

Parameters

integer $n

Returns

\dooaki\Container\Lazy\Enumerator

tap()

tap(callable  $action) : \dooaki\Container\Lazy\Enumerator

Return Enumerator which calls $action

Parameters

callable $action

Returns

\dooaki\Container\Lazy\Enumerator

transpose()

transpose() : \dooaki\Container\Lazy\Enumerator|\dooaki\Container\Lazy\Generator

Return Enumerator which returns transposed Array

Returns

\dooaki\Container\Lazy\Enumerator|\dooaki\Container\Lazy\Generator

flatten()

flatten() : \dooaki\Container\Lazy\Enumerator|\dooaki\Container\Lazy\Generator

Return Enumerator which flatten values

Returns

\dooaki\Container\Lazy\Enumerator|\dooaki\Container\Lazy\Generator

first()

first() : mixed

Return first element of each()

Returns

mixed —

first element of each()

last()

last() : \dooaki\Container\Lazy\mixd

Return last element of each()

Returns

\dooaki\Container\Lazy\mixd —

last element of each()

any()

any(callable  $predicate) : boolean

Return true if any $predicate returns value is true

Parameters

callable $predicate

Returns

boolean

all()

all(callable  $predicate) : boolean

Return true if all $predicate returns value is true

Parameters

callable $predicate

Returns

boolean

apply()

apply(callable  $action) : void

apply $action to all elements

Parameters

callable $action

toArray()

toArray() : array

Return an array overwrite if found same key containing the elements in each()

Returns

array

toArrayValues()

toArrayValues() : array

Return an array containing the elements in each()

Returns

array

__construct()

__construct(callable  $callable) 

Parameters

callable $callable

each()

each(callable  $action = null) 

Parameters

callable $action

from()

from(  $array_or_traversable) : \dooaki\Container\Lazy\dooaki\Container\Lazy\Enumerator

make Enumerable object from array or Traversable

@param mixed $array_or_traversable array or Traversable

Parameters

$array_or_traversable

Returns

\dooaki\Container\Lazy\dooaki\Container\Lazy\Enumerator

_toArray()

_toArray(  $result,   $k,   $v) 

Parameters

$result
$k
$v

_toArrayValues()

_toArrayValues(  $result,   $v) 

Parameters

$result
$v

isIterable()

isIterable(  $target) 

Parameters

$target