PHP 클래스 Parkour\Transform

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

공개 메소드들

메소드 설명
combine ( array $data, callable $cb, boolean $overwrite = true ) : array Indexes an array depending on the values it contains.
merge ( array $first, array $second ) : array Merges two arrays recursively.
normalize ( array $data, mixed $default ) : array Makes every value that is numerically indexed a key, given $default as value.
reindex ( array $data, array $map, $keepUnmapped = true ) : array Reindexes a list of values.

메소드 상세

combine() 공개 정적인 메소드

Indexes an array depending on the values it contains.
public static combine ( array $data, callable $cb, boolean $overwrite = true ) : array
$data array Data.
$cb callable Function to combine values.
$overwrite boolean Should duplicate keys be overwritten ?
리턴 array Indexed values.

merge() 공개 정적인 메소드

Merges two arrays recursively.
public static merge ( array $first, array $second ) : array
$first array Original data.
$second array Data to be merged.
리턴 array Merged data.

normalize() 공개 정적인 메소드

Makes every value that is numerically indexed a key, given $default as value.
public static normalize ( array $data, mixed $default ) : array
$data array Data.
$default mixed Default value.
리턴 array Normalized values.

reindex() 공개 정적인 메소드

Reindexes a list of values.
public static reindex ( array $data, array $map, $keepUnmapped = true ) : array
$data array Data.
$map array An map of correspondances of the form ['currentIndex' => 'newIndex'].
리턴 array $keepUnmapped Whether or not to keep keys that are not remapped.