| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function testHttpRawPostData() |
||
| 24 | { |
||
| 25 | $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '5.5'); |
||
| 26 | $this->assertNoViolation($file); |
||
| 27 | |||
| 28 | $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '5.6'); |
||
| 29 | $this->assertWarning($file, 3, "Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 - use php://input instead"); |
||
| 30 | |||
| 31 | $file = $this->sniffFile('sniff-examples/removed_global_variables.php', '7.0'); |
||
| 32 | $this->assertError($file, 3, "Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0 - use php://input instead"); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.