Completed
Push — feature/symfony-config ( 4ab920...aead33 )
by Yo
01:59
created

PrefixerServiceNameResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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 PrefixerServiceNameResolver
8
 */
9
class PrefixerServiceNameResolver implements ServiceNameResolverInterface
10
{
11
    /** @var string */
12
    private $prefix;
13
14
    /**
15
     * @param string $prefix
16
     */
17 1
    public function __construct(string $prefix)
18
    {
19 1
        $this->prefix = $prefix;
20 1
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 1
    public function resolve(string $methodName) : string
26
    {
27 1
        return $this->prefix.$methodName;
28
    }
29
}
30