Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 9 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | public function testDirnameDepth() |
||
24 | { |
||
25 | $file = $this->sniffFile('sniff-examples/new_function_parameter.php', '5.6'); |
||
26 | $this->assertError($file, 3, "The function dirname does not have a parameter depth in PHP version 5.6 or earlier"); |
||
27 | |||
28 | // Verify that sniff doesn't throw an error in version 5.2 |
||
29 | $file = $this->sniffFile('sniff-examples/new_function_parameter.php', '7.0'); |
||
30 | $this->assertNoViolation($file, 3); |
||
31 | } |
||
32 | } |
||
33 |
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.