Pinq\ITraversable::orderByDescending PHP Method

orderByDescending() public method

Orders the values mapped from the supplied function descendingly Example expression function:
public orderByDescending ( callable $function ) : Pinq\Interfaces\IOrderedTraversable
$function callable The mapping function
return Pinq\Interfaces\IOrderedTraversable
    public function orderByDescending(callable $function);

Usage Example

Example #1
0
 /**
  * @dataProvider names
  */
 public function testThatOrderByDescendingIsEquivalentToOrderByWithDescendingDirection(\Pinq\ITraversable $names, array $data)
 {
     $function = function ($i) {
         return $i[0];
     };
     $orderedNames = $names->orderByDescending($function);
     $otherOrderedNames = $names->orderBy($function, \Pinq\Direction::DESCENDING);
     $this->assertSame($orderedNames->asArray(), $otherOrderedNames->asArray());
 }