Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php  | 
            ||
| 17 | class PHPCompatibility_Sniffs_PHP_ValidIntegersSniff extends PHPCompatibility_Sniff  | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 18 | { | 
            ||
| 19 | protected $isLowPHPVersion = false;  | 
            ||
| 20 | |||
| 21 | /**  | 
            ||
| 22 | * Returns an array of tokens this test wants to listen for.  | 
            ||
| 23 | *  | 
            ||
| 24 | * @return array  | 
            ||
| 25 | */  | 
            ||
| 26 | public function register()  | 
            ||
| 36 | |||
| 37 | |||
| 38 | /**  | 
            ||
| 39 | * Processes this test, when one of its tokens is encountered.  | 
            ||
| 40 | *  | 
            ||
| 41 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.  | 
            ||
| 42 | * @param int $stackPtr The position of the current token in  | 
            ||
| 43 | * the stack.  | 
            ||
| 44 | *  | 
            ||
| 45 | * @return void  | 
            ||
| 46 | */  | 
            ||
| 47 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)  | 
            ||
| 99 | |||
| 100 | |||
| 101 | /**  | 
            ||
| 102 | * Could the current token an potentially be a binary integer ?  | 
            ||
| 103 | *  | 
            ||
| 104 | * @param array $token Token stack.  | 
            ||
| 105 | * @param int $stackPtr The current position in the token stack.  | 
            ||
| 106 | *  | 
            ||
| 107 | * @return bool  | 
            ||
| 108 | */  | 
            ||
| 109 |     private function couldBeBinaryInteger($tokens, $stackPtr) { | 
            ||
| 125 | |||
| 126 | /**  | 
            ||
| 127 | * Is the current token an invalid binary integer ?  | 
            ||
| 128 | *  | 
            ||
| 129 | * @param array $token Token stack.  | 
            ||
| 130 | * @param int $stackPtr The current position in the token stack.  | 
            ||
| 131 | *  | 
            ||
| 132 | * @return bool  | 
            ||
| 133 | */  | 
            ||
| 134 |     private function isInvalidBinaryInteger($tokens, $stackPtr) { | 
            ||
| 147 | |||
| 148 | /**  | 
            ||
| 149 | * Retrieve the content of the tokens which together look like a binary integer.  | 
            ||
| 150 | *  | 
            ||
| 151 | * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.  | 
            ||
| 152 | * @param array $token Token stack.  | 
            ||
| 153 | * @param int $stackPtr The position of the current token in  | 
            ||
| 154 | * the stack.  | 
            ||
| 155 | *  | 
            ||
| 156 | * @return string  | 
            ||
| 157 | */  | 
            ||
| 158 |     private function getBinaryInteger(PHP_CodeSniffer_File $phpcsFile, $tokens, $stackPtr) { | 
            ||
| 171 | |||
| 172 | /**  | 
            ||
| 173 | * Is the current token an invalid octal integer ?  | 
            ||
| 174 | *  | 
            ||
| 175 | * @param array $token Token stack.  | 
            ||
| 176 | * @param int $stackPtr The current position in the token stack.  | 
            ||
| 177 | *  | 
            ||
| 178 | * @return bool  | 
            ||
| 179 | */  | 
            ||
| 180 | View Code Duplication |     private function isInvalidOctalInteger($tokens, $stackPtr) { | 
            |
| 189 | |||
| 190 | /**  | 
            ||
| 191 | * Is the current token a hexidecimal numeric string ?  | 
            ||
| 192 | *  | 
            ||
| 193 | * @param array $token Token stack.  | 
            ||
| 194 | * @param int $stackPtr The current position in the token stack.  | 
            ||
| 195 | *  | 
            ||
| 196 | * @return bool  | 
            ||
| 197 | */  | 
            ||
| 198 | View Code Duplication |     private function isHexidecimalNumericString($tokens, $stackPtr) { | 
            |
| 207 | |||
| 208 | }//end class  | 
            ||
| 209 | 
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.