Completed
Pull Request — master (#178)
by Juliette
02:41
created

testSettingTestVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * Functions can not have multiple parameters with the same name since PHP 7.0 test file
4
 *
5
 * @package PHPCompatibility
6
 */
7
8
9
/**
10
 * Functions can not have multiple parameters with the same name since PHP 7.0 sniff test
11
 *
12
 * @uses BaseSniffTest
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16 View Code Duplication
class ForbiddenFunctionParametersWithSameNameSniffTest extends BaseSniffTest
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
17
{
18
    /**
19
     * testSettingTestVersion
20
     *
21
     * @group forbiddenFunctionParamsSameName
22
     *
23
     * @return void
24
     */
25
    public function testSettingTestVersion()
26
    {
27
        $file = $this->sniffFile('sniff-examples/forbidden_function_parameters_with_same_name.php', '5.6');
28
        $this->assertNoViolation($file, 3);
29
        
30
        $file = $this->sniffFile('sniff-examples/forbidden_function_parameters_with_same_name.php', '7.0');
31
        $this->assertError($file, 3, 'Functions can not have multiple parameters with the same name since PHP 7.0');
32
    }
33
}
34
35