ApiResolver::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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