private function fixSpacing(File $phpcs_file, $tokens, $required_spacing, $start, $end): void
    {
        if (($start + 1) === $end && empty($required_spacing) === false) {
            //insert whitespace if there is no whitespace, and whitespace is required
            $phpcs_file->fixer->addContent($start, $required_spacing);

            return;
        }

        //otherwise, if there is whitespace, change the whitespace to the required spacing
        for ($i = ($start + 1); $i < $end; $i++) {
            if ($tokens[$i]['code'] !== T_WHITESPACE) {
                continue;
            }

            if (($i + 1) === $end) {
                $phpcs_file->fixer->replaceToken($i, $required_spacing);
                continue;
            }

            $phpcs_file->fixer->replaceToken($i, '');
        }
    }