HH\invariant_violation

Call this when one of your invariants has been violated

namespace HH;

function invariant_violation(
  FormatString<\PlainSprintf> $format_str,
  ...$fmt_args,
): noreturn;

It calls the function you registered with invariant_callback_register and then throws an InvariantException

Parameters

  • FormatString<\PlainSprintf> $format_str - The string that will be displayed when your invariant fails.
  • ...$fmt_args

Returns

  • noreturn