Whether the given position is immediately surrounded by braces.
int $startPos Start position:
int $endPos End position:
public function haveBraces(int $startPos, int $endPos) : bool { return ($this->haveTokenImmediatelyBefore($startPos, '{') || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) && $this->haveTokenImmediatelyAfter($endPos, '}'); }