PHP 클래스 Parkour\Traverse

파일 보기 프로젝트 열기: benjamminf/craft-embedded-assets 1 사용 예제들

공개 메소드들

메소드 설명
customFilter ( array $data, callable $cb, $keyed = true )
each ( array $data, callable $cb ) Iterates over the given data.
every ( array $data, callable $cb ) : boolean Returns true if every element of the given data passes a thruth test.
filter ( array $data, callable $cb, $keyed = true ) : array Filters each of the given values through a function.
find ( array $data, callable $cb, mixed $default = null ) : mixed Finds a value in the given data.
findKey ( array $data, callable $cb, mixed $default = null ) : integer | string Finds a value in the given data and returns its key.
map ( array $data, callable $cb ) : array Updates each of the given values.
mapKeys ( array $data, callable $cb ) : array Updates the keys each of the given data.
nativeFilter ( array $data, callable $cb, $keyed = true )
reduce ( array $data, callable $cb, mixed $memo ) : mixed Boils down a list of values to a single value.
reject ( array $data, callable $cb, $keyed = true ) : array The opposite of filter().
some ( array $data, callable $cb ) : boolean Returns true if some elements of the given data passes a thruth test.

메소드 상세

customFilter() 공개 정적인 메소드

또한 보기: filter()
public static customFilter ( array $data, callable $cb, $keyed = true )
$data array
$cb callable

each() 공개 정적인 메소드

Iterates over the given data.
public static each ( array $data, callable $cb )
$data array Data.
$cb callable Function that receives values.

every() 공개 정적인 메소드

Returns true if every element of the given data passes a thruth test.
public static every ( array $data, callable $cb ) : boolean
$data array Data.
$cb callable Test.
리턴 boolean If every element passes the test.

filter() 공개 정적인 메소드

Filters each of the given values through a function.
public static filter ( array $data, callable $cb, $keyed = true ) : array
$data array Data.
$cb callable Function to filter values.
리턴 array Filtered data.

find() 공개 정적인 메소드

Finds a value in the given data.
public static find ( array $data, callable $cb, mixed $default = null ) : mixed
$data array Data.
$cb callable Function to find value.
$default mixed Default value.
리턴 mixed Value.

findKey() 공개 정적인 메소드

Finds a value in the given data and returns its key.
public static findKey ( array $data, callable $cb, mixed $default = null ) : integer | string
$data array Data.
$cb callable Function to find value.
$default mixed Default value.
리턴 integer | string Key.

map() 공개 정적인 메소드

Updates each of the given values.
public static map ( array $data, callable $cb ) : array
$data array Data.
$cb callable Function to map values.
리턴 array Mapped data.

mapKeys() 공개 정적인 메소드

Updates the keys each of the given data.
public static mapKeys ( array $data, callable $cb ) : array
$data array Data.
$cb callable Function to map keys.
리턴 array Mapped data.

nativeFilter() 공개 정적인 메소드

또한 보기: filter()
public static nativeFilter ( array $data, callable $cb, $keyed = true )
$data array
$cb callable

reduce() 공개 정적인 메소드

Boils down a list of values to a single value.
public static reduce ( array $data, callable $cb, mixed $memo ) : mixed
$data array Data.
$cb callable Function to reduce values.
$memo mixed Initial value.
리턴 mixed Result.

reject() 공개 정적인 메소드

The opposite of filter().
public static reject ( array $data, callable $cb, $keyed = true ) : array
$data array Data.
$cb callable Function to filter values.
리턴 array Filtered data.

some() 공개 정적인 메소드

Returns true if some elements of the given data passes a thruth test.
public static some ( array $data, callable $cb ) : boolean
$data array Data.
$cb callable Test.
리턴 boolean If some elements passes the test.