This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
lnkohana/vendor/phpunit/php-code-coverage/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php

23 lines
597 B
PHP
Raw Permalink Normal View History

2013-04-22 04:09:50 +00:00
<?php
class PHPCS_Sniffs_Whitespace_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff
{
public function register()
{
return array(T_STRING_CONCAT);
}
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE ||
$tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
$phpcsFile->addError(
'Concatenation operator must be surrounded by whitespace',
$stackPtr
);
}
}
}