| Conditions | 2 |
| Paths | 2 |
| Total Lines | 31 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 40 | protected function setUp() |
||
| 41 | { |
||
| 42 | parent::setUp(); |
||
| 43 | |||
| 44 | $this->helperClass = new TestHelperPHPCompatibility; |
||
| 45 | |||
| 46 | $filename = realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . $this->filename; |
||
| 47 | $phpcs = new PHP_CodeSniffer(); |
||
| 48 | |||
| 49 | if (version_compare(PHP_CodeSniffer::VERSION, '2.0', '<')) { |
||
| 50 | $this->_phpcsFile = new PHP_CodeSniffer_File( |
||
| 51 | $filename, |
||
| 52 | array(), |
||
| 53 | array(), |
||
| 54 | array(), |
||
| 55 | array(), |
||
| 56 | $phpcs |
||
| 57 | ); |
||
| 58 | } |
||
| 59 | else { |
||
| 60 | $this->_phpcsFile = new PHP_CodeSniffer_File( |
||
| 61 | $filename, |
||
| 62 | array(), |
||
| 63 | array(), |
||
| 64 | $phpcs |
||
| 65 | ); |
||
| 66 | } |
||
| 67 | |||
| 68 | $contents = file_get_contents($filename); |
||
| 69 | $this->_phpcsFile->start($contents); |
||
| 70 | } |
||
| 71 | |||
| 84 |
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.