public function toBeSortedBy()

in src/ExpectObj.hack [337:353]


  public function toBeSortedBy<Tv>(
    (function(Tv, Tv): bool) $comparator,
    string $msg = '',
    mixed ...$args
  ): void where T as Container<Tv> {
    $msg = \vsprintf($msg, $args);

    $actual = $this->var;
    invariant(
      $actual is Traversable<_>,
      'ERROR: expect(...$args)->toBeSortedByKey only can be applied to '.
      'Traversables, not %s.',
      print_type($actual),
    );

    $this->assertIsSorted($actual, $comparator, $msg);
  }