| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function testDeprecatedNewReference($line) |
||
| 30 | { |
||
| 31 | $file = $this->sniffFile(self::TEST_FILE, '5.2'); |
||
| 32 | $this->assertNoViolation($file, $line); |
||
| 33 | |||
| 34 | $file = $this->sniffFile(self::TEST_FILE, '5.3'); |
||
| 35 | $this->assertWarning($file, $line, 'Assigning the return value of new by reference is deprecated in PHP 5.3'); |
||
| 36 | |||
| 37 | $file = $this->sniffFile(self::TEST_FILE, '7.0'); |
||
| 38 | $this->assertError($file, $line, 'Assigning the return value of new by reference is deprecated in PHP 5.3 and forbidden in PHP 7.0'); |
||
| 39 | |||
| 40 | } |
||
| 41 | |||
| 69 |
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.