Passed
Pull Request — master (#11)
by Volodymyr
09:33 queued 04:51
created

ProductModelDraftApiAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Product;
9
10
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
11
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface;
12
13
class ProductModelDraftApiAdapter implements ProductModelDraftApiAdapterInterface
14
{
15
    /**
16
     * @var \Akeneo\Pim\ApiClient\AkeneoPimClientInterface
17
     */
18
    protected $akeneoPimClient;
19
20
    /**
21
     * @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface
22
     */
23
    protected $wrapperFactory;
24
25
    /**
26
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
27
     * @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory
28
     */
29
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient, WrapperFactoryInterface $wrapperFactory)
30
    {
31
        $this->akeneoPimClient = $akeneoPimClient;
32
        $this->wrapperFactory = $wrapperFactory;
33
    }
34
35
    /**
36
     * @param string $code
37
     *
38
     * @return array
39
     */
40
    public function get($code): array
41
    {
42
        return $this->akeneoPimClient
43
            ->getProductModelDraftApi()
0 ignored issues
show
Bug introduced by
The method getProductModelDraftApi() does not exist on Akeneo\Pim\ApiClient\AkeneoPimClientInterface. Did you maybe mean getProductModelApi()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
            ->/** @scrutinizer ignore-call */ getProductModelDraftApi()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
44
            ->get($code);
45
    }
46
}
47