Esempio n. 1
0
/**
 * @param array|\iterator $peopleKeyedById
 * @return array
 */
function exampleExtractKeys3($peopleKeyedById)
{
    $keys = Sequence::make($peopleKeyedById)->map(fn\fnSwapParamsPassThrough(fn\fnIdentity()))->values()->to_a();
    return $keys;
}
Esempio n. 2
0
 /**
  * Generate a function that swaps the order of the parameters and calls $fn
  *
  * @param callable $fn
  * @return callable
  */
 public static function fnSwapParamsPassThrough($fn)
 {
     return fn\fnSwapParamsPassThrough($fn);
 }