Passed
Pull Request — master (#1)
by Yo
02:14
created

DefaultServiceNameResolver::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 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