protected function processReturnAboveThrows(File $phpcsFile, $stackPtr)
    {
        // Fetches the full function docblock
        $startToken = null;
        $endToken = null;
        $docblock = $this->getDocBlock($phpcsFile, $stackPtr, $startToken, $endToken);
        if ($this->hasInheritDoc($phpcsFile, $stackPtr, $docblock)) {
            return;
        }

        // Fetches tag locations
        $return_pos = strpos($docblock, '@return');
        $throws_pos = strpos($docblock, '@throws');

        // One of the elements doesn't exist
        if ($throws_pos === false || $return_pos === false) {
            return;
        }

        // Is the throws above return?
        if ($return_pos > $throws_pos) {
            $error = '@throws tags should be below the @return tag, not above the @return tag';
            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'ReturnAboveThrows');

            // When the patcher is active, fix the issue
            if ($fix === true) {
                // Breaks up the docblock in three parts; original docblock, return and throws
                $parts = explode('* @', $docblock);
                $general = $return = $throws = array();
                foreach ($parts as $part) {
                    if (strtolower(substr($part, 0, 6)) == 'return') {
                        array_push($return, $part);
                    } else if (strtolower(substr($part, 0, 6)) == 'throws') {
                        array_push($throws, $part);
                    } else {
                        array_push($general, $part);
                    }
                }

                // Reglues the three parts in correct sequence
                $newDocblock = implode('* @', array_merge(
                    $general,
                    $return,
                    $throws
                ));

                // Patches the file
                $phpcsFile->fixer->beginChangeset();
                $phpcsFile->fixer->replaceToken($startToken, $newDocblock);
                for ($token = $startToken + 1; $token < $endToken; ++$token) {
                    $phpcsFile->fixer->replaceToken($token, "");
                }
                $phpcsFile->fixer->endChangeset();
            }
        }
    }