diff --git a/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml b/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml deleted file mode 100644 index 80b932d277..0000000000 --- a/src/Standards/Generic/Docs/Formatting/NoSpaceAfterCastStandard.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - 1; - ]]> - - - diff --git a/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php b/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php deleted file mode 100644 index 008d27662d..0000000000 --- a/src/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php +++ /dev/null @@ -1,98 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - * - * @deprecated 3.4.0 Use the Generic.Formatting.SpaceAfterCast sniff with - * the $spacing property set to 0 instead. - */ - -namespace PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting; - -use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Sniffs\DeprecatedSniff; -use PHP_CodeSniffer\Sniffs\Sniff; -use PHP_CodeSniffer\Util\Tokens; - -class NoSpaceAfterCastSniff implements Sniff, DeprecatedSniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - return; - } - - $error = 'A cast statement must not be followed by a space'; - $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceFound'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($stackPtr + 1), ''); - } - - }//end process() - - - /** - * Provide the version number in which the sniff was deprecated. - * - * @return string - */ - public function getDeprecationVersion() - { - return 'v3.4.0'; - - }//end getDeprecationVersion() - - - /** - * Provide the version number in which the sniff will be removed. - * - * @return string - */ - public function getRemovalVersion() - { - return 'v4.0.0'; - - }//end getRemovalVersion() - - - /** - * Provide a custom message to display with the deprecation. - * - * @return string - */ - public function getDeprecationMessage() - { - return 'Use the Generic.Formatting.SpaceAfterCast sniff with the $spacing property set to 0 instead.'; - - }//end getDeprecationMessage() - - -}//end class diff --git a/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc b/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc deleted file mode 100644 index f41b9a84e8..0000000000 --- a/src/Standards/Generic/Tests/Formatting/NoSpaceAfterCastUnitTest.inc +++ /dev/null @@ -1,51 +0,0 @@ - - * @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) - * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence - */ - -namespace PHP_CodeSniffer\Standards\Generic\Tests\Formatting; - -use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; - -/** - * Unit test class for the NoSpaceAfterCast sniff. - * - * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\NoSpaceAfterCastSniff - */ -final class NoSpaceAfterCastUnitTest extends AbstractSniffUnitTest -{ - - - /** - * Returns the lines where errors should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of errors that should occur on that line. - * - * @return array - */ - public function getErrorList() - { - return [ - 3 => 1, - 5 => 1, - 7 => 1, - 9 => 1, - 11 => 1, - 13 => 1, - 15 => 1, - 17 => 1, - 19 => 1, - 21 => 1, - 23 => 1, - 25 => 1, - 27 => 1, - 29 => 1, - 31 => 1, - 33 => 1, - 35 => 1, - 37 => 1, - 39 => 1, - 41 => 1, - 43 => 1, - 45 => 1, - 50 => 1, - ]; - - }//end getErrorList() - - - /** - * Returns the lines where warnings should occur. - * - * The key of the array should represent the line number and the value - * should represent the number of warnings that should occur on that line. - * - * @return array - */ - public function getWarningList() - { - return []; - - }//end getWarningList() - - -}//end class