private function endingToken(int $tokenID): int
    {
        $level = null;
        for ($localID = $tokenID; $localID < $this->countTokens; ++$localID) {
            $token = $this->tokens[$localID];
            if ($token[self::TOKEN_CODE] == '{') {
                ++$level;
                continue;
            }

            if ($token[self::TOKEN_CODE] == '}') {
                --$level;
            }

            if ($level === 0) {
                break;
            }
        }

        return $localID;
    }