Пример #1
0
 /**
  * reduceRight - ReduceRight is like reduce, but it is used for combining values into values of the same type.  This is perfect for things like
  * summing values, concatenating strings, union arrays, etc.
  * Note, the items will be walked in reverse order.  This means the entire sequence will be reversed before the reduce is applied.
  *
  * Example: Sequence::make(['one','two','three'])->reduceRight(fn\fnStringConcat('.')) = 'three.two.one'
  *
  * @param callable $fn($prevValue, $currentValue, $currentKey) -- The $fn predicate is a function(T $prevValue, T $currentValue) that returns type T|null.
  * @return mixed
  */
 public function reduceRight($fn)
 {
     return IterationTraits::reduceRight($this, $fn);
 }