protected function checkContent(File $phpcsFile, $stackPtr, $before)
    {
        if ($before === true) {
            $contentToken = ($phpcsFile->findPrevious(
                T_WHITESPACE,
                ($stackPtr - 1),
                null,
                true
            ) + 1);
            $errorWord    = 'before';
        } else {
            $contentToken = ($phpcsFile->findNext(
                T_WHITESPACE,
                ($stackPtr + 1),
                null,
                true
            ) - 1);
            $errorWord    = 'after';
        }

        $tokens      = $phpcsFile->getTokens();
        $contentData = $tokens[$contentToken];

        if ($contentData['line'] !== $tokens[$stackPtr]['line']) {
            // Ignore concat operator split across several lines.
            return;
        }

        if ($contentData['code'] !== T_WHITESPACE) {
            $fix = $phpcsFile->addFixableError(
                'Expected 1 space '.$errorWord.' concat operator; 0 found',
                $stackPtr,
                'NoSpace'.ucfirst($errorWord)
            );

            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();

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

                $phpcsFile->fixer->endChangeset();
            }
        } elseif ($contentData['length'] !== 1) {
            $data = array($contentData['length']);
            $fix  = $phpcsFile->addFixableError(
                'Expected 1 space '.$errorWord.' concat operator; %s found',
                $stackPtr,
                'SpaceBefore'.ucfirst($errorWord),
                $data
            );

            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();
                $phpcsFile->fixer->replaceToken($contentToken, ' ');
                $phpcsFile->fixer->endChangeset();
            }
        }
    }