ApiResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 25
wmc 2
lcom 1
cbo 2
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getApi() 0 4 1
A __construct() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the Lakion package.
5
 *
6
 * (c) Lakion
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Api;
13
14
use Sylius\Api\Map\UriMapInterface;
15
16
/**
17
 * @author Michał Marcinkowski <[email protected]>
18
 */
19
class ApiResolver implements ApiResolverInterface
20
{
21
    /**
22
     * @var UriMapInterface
23
     */
24
    private $uriMap;
25
    /**
26
     * @var ClientInterface
27
     */
28
    private $client;
29
30
    public function __construct(ClientInterface $client, UriMapInterface $uriMap)
31
    {
32
        $this->client = $client;
33
        $this->uriMap = $uriMap;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getApi($resource)
40
    {
41
        return new GenericApi($this->client, $this->uriMap->getUri($resource));
42
    }
43
}
44