HH\Readonly\Shapes::at

Returns the value of the field $index of a readonly $shape, throws if the field is missing

public static function at(
  shape() $shape,
  arraykey $index,
): mixed;

Use this to access optional fields on readonly shapes.

Parameters

  • shape() $shape
  • arraykey $index

Returns

  • mixed