public static function findStartOfStatement(File $phpcsFile, $start, $ignore = null)
    {
        if (version_compare(self::getVersion(), '2.7.1', '>=') === true) {
            return $phpcsFile->findStartOfStatement($start, $ignore);
        }

        $tokens    = $phpcsFile->getTokens();
        $endTokens = Tokens::$blockOpeners;

        $endTokens[\T_COLON]            = true;
        $endTokens[\T_COMMA]            = true;
        $endTokens[\T_DOUBLE_ARROW]     = true;
        $endTokens[\T_SEMICOLON]        = true;
        $endTokens[\T_OPEN_TAG]         = true;
        $endTokens[\T_CLOSE_TAG]        = true;
        $endTokens[\T_OPEN_SHORT_ARRAY] = true;

        if ($ignore !== null) {
            $ignore = (array) $ignore;
            foreach ($ignore as $code) {
                if (isset($endTokens[$code]) === true) {
                    unset($endTokens[$code]);
                }
            }
        }

        $lastNotEmpty = $start;

        for ($i = $start; $i >= 0; $i--) {
            if (isset($endTokens[$tokens[$i]['code']]) === true) {
                // Found the end of the previous statement.
                return $lastNotEmpty;
            }

            if (isset($tokens[$i]['scope_opener']) === true
                && $i === $tokens[$i]['scope_closer']
            ) {
                // Found the end of the previous scope block.
                return $lastNotEmpty;
            }

            // Skip nested statements.
            if (isset($tokens[$i]['bracket_opener']) === true
                && $i === $tokens[$i]['bracket_closer']
            ) {
                $i = $tokens[$i]['bracket_opener'];
            } elseif (isset($tokens[$i]['parenthesis_opener']) === true
                && $i === $tokens[$i]['parenthesis_closer']
            ) {
                $i = $tokens[$i]['parenthesis_opener'];
            }

            if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === false) {
                $lastNotEmpty = $i;
            }
        }//end for

        return 0;
    }