/** * @param array|\iterator $peopleKeyedById * @return array */ function exampleExtractKeys3($peopleKeyedById) { $keys = Sequence::make($peopleKeyedById)->map(fn\fnSwapParamsPassThrough(fn\fnIdentity()))->values()->to_a(); return $keys; }
/** * 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); }