protected function checkSpacing(File $phpcsFile, $stackPtr, $before)
    {
        if ($before === true) {
            $stackPtrDiff = -1;
            $errorWord    = 'prefix';
            $errorCode    = 'Before';
        } else {
            $stackPtrDiff = 1;
            $errorWord    = 'follow';
            $errorCode    = 'After';
        }

        $tokens    = $phpcsFile->getTokens();
        $tokenData = $tokens[($stackPtr + $stackPtrDiff)];

        if ($tokenData['code'] !== T_WHITESPACE) {
            $error = 'Whitespace must '.$errorWord.' the item assignment operator =>';
            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpacing'.$errorCode);
            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();

                if ($before === true) {
                    $phpcsFile->fixer->addContentBefore($stackPtr, ' ');
                } else {
                    $phpcsFile->fixer->addContent($stackPtr, ' ');
                }

                $phpcsFile->fixer->endChangeset();
            }

            return;
        }

        if (isset($tokenData['orig_content']) === true) {
            $content = $tokenData['orig_content'];
        } else {
            $content = $tokenData['content'];
        }

        if ($this->hasOnlySpaces($content) === false) {
            $error = 'Spaces must be used to '.$errorWord.' the item assignment operator =>';
            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'MixedWhitespace'.$errorCode);
            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();
                $phpcsFile->fixer->replaceToken(
                    ($stackPtr + $stackPtrDiff),
                    str_repeat(' ', strlen($content))
                );
                $phpcsFile->fixer->endChangeset();
            }
        }
    }