CallableValueResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 2
c 1
b 1
f 1
lcom 1
cbo 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A resolve() 0 8 1
1
<?php
2
3
namespace Cascade\Mapper\Value\Resolver;
4
5
class CallableValueResolver implements ValueResolverInterface
6
{
7
    /**
8
     * @var callable
9
     */
10
    private $callback;
11
12
    /**
13
     * @param callable $callback
14
     */
15 4
    public function __construct(callable $callback)
16
    {
17 4
        $this->callback = $callback;
18 4
    }
19
20 4
    public function resolve($source, $destination)
21
    {
22 4
        return call_user_func(
23 4
            $this->callback,
24 4
            $source,
25
            $destination
26 4
        );
27
    }
28
}
29