ApiAdapterFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 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\Factory;
13
14
use Sylius\Api\ApiAdapter;
15
use Sylius\Api\ApiInterface;
16
17
/**
18
 * @author Michał Marcinkowski <[email protected]>
19
 */
20
class ApiAdapterFactory implements AdapterFactoryInterface
21
{
22
    /**
23
     * @var ApiInterface $api
24
     */
25
    private $api;
26
27
    public function __construct(ApiInterface $api)
28
    {
29
        $this->api = $api;
30
    }
31
32
    /**
33
     * {@inheritdoc }
34
     */
35
    public function create()
36
    {
37
        return new ApiAdapter($this->api);
38
    }
39
}
40