CallableMatcherTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildMatcher() 0 8 2
A getEquals() 0 6 1
A getNotEquals() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the rafrsr/lib-array2object package.
5
 *
6
 * (c) Rafael SR <https://github.com/rafrsr>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Rafrsr\LibArray2Object\Tests\Matcher;
12
13
use Rafrsr\LibArray2Object\Matcher\CallableMatcher;
14
15
class CallableMatcherTest extends PropertyMatcherTester
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function buildMatcher()
21
    {
22
        return new CallableMatcher(
23
            function (\ReflectionProperty $property, $givenName) {
24
                return $givenName === 'prueba' && $property->getName() === 'test';
25
            }
26
        );
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function getEquals()
33
    {
34
        return [
35
            'test' => 'prueba',
36
        ];
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getNotEquals()
43
    {
44
        return [
45
            'test' => 'name',
46
        ];
47
    }
48
}
49