NamedArgsTest::testStaticCall()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
cc 1
eloc 13
c 3
b 0
f 1
nc 1
nop 0
dl 0
loc 23
rs 9.8333
1
<?php
2
use PHPUnit\Framework\TestCase;
3
4
5
require ($dir = dirname(__DIR__)).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'namedArgsHelper.php';
6
require ($dir = dirname(__DIR__)).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'namedArgs.php';
7
require $dir.DIRECTORY_SEPARATOR.'Args.php';
8
use EZAMA\NamedArgs;
9
class NamedArgsTest extends TestCase
10
{
11
    public function testStaticCall()
12
    {
13
        $this->assertEquals(
14
            NamedArgs::preg_match_all(
0 ignored issues
show
Bug introduced by
The method preg_match_all() does not exist on EZAMA\namedArgs. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
            NamedArgs::/** @scrutinizer ignore-call */ 
15
                       preg_match_all(
Loading history...
15
                args(
16
                    [
17
                        'subpatterns'=>&$matches0,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $matches0 seems to be never defined.
Loading history...
18
                        'pattern'=>'#a|o|i|u|e#',
19
                        'subject'=>'gris|gros|gras|grue'
20
                    ]
21
                )
22
            ),
23
            preg_match_all('#a|o|i|u|e#', 'gris|gros|gras|grue', $matches1)
24
        );
25
        
26
        $this->assertEquals($matches0, $matches1);
27
        
28
        $this->assertTrue(
29
            (bool) NamedArgs::preg_match(
0 ignored issues
show
Bug introduced by
The method preg_match() does not exist on EZAMA\namedArgs. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
            (bool) NamedArgs::/** @scrutinizer ignore-call */ preg_match(
Loading history...
30
                [
31
                            'subpatterns'=>&$match,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $match seems to be never defined.
Loading history...
32
                            'pattern'=>'#a|o|i|u|e#',
33
                            'subject'=>'gris|gros|gras|grue'
34
                ]
35
            )
36
        );
37
    }
38
}