Passed
Branch master (aa5120)
by Yo
02:31
created

DefaultServiceNameResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A resolve() 0 3 1
1
<?php
2
namespace Yoanm\JsonRpcServerPsr11Resolver\App\Resolver;
3
4
use Yoanm\JsonRpcServerPsr11Resolver\Domain\Model\ServiceNameResolverInterface;
5
6
/**
7
 * Class ContainerMethodResolver
8
 */
9
class DefaultServiceNameResolver implements ServiceNameResolverInterface
10
{
11
    /** @var string */
12
    private $prefix = '';
13
14
    /**
15
     * @param string $prefix
16
     */
17 2
    public function __construct(string $prefix = '')
18
    {
19 2
        $this->prefix = $prefix;
20 2
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 2
    public function resolve(string $methodName) : string
26
    {
27 2
        return $this->prefix.$methodName;
28
    }
29
}
30