TimeTrex/vendor/phpunit/phpunit-selenium/build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php

23 lines
597 B
PHP
Raw Normal View History

2022-12-13 07:10:06 +01: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
);
}
}
}