public function toContainKey()

in src/ExpectObj.hack [264:278]


  public function toContainKey<TKey as arraykey, TVal>(
    TKey $key,
    string $msg = '',
    mixed ...$args
  ): void where T as KeyedContainer<TKey, TVal> {
    $msg = \vsprintf($msg, $args);
    $obj = $this->var;
    invariant(
      $obj is KeyedContainer<_, _>,
      'ERROR: expect(...$args)->toContainKey only can be applied to '.
      'KeyedContainers, not %s.',
      print_type($obj),
    );
    $this->assertTrue(\array_key_exists($key, $obj), $msg);
  }