Passed
Pull Request — master (#11)
by Oleksandr
04:55
created

ProductDraftApiAdapter::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
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\Pim\ApiClient\Exception\HttpException;
11
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
12
13
class ProductDraftApiAdapter implements ProductDraftApiAdapterInterface
14
{
15
    /**
16
     * @var \Akeneo\Pim\ApiClient\AkeneoPimClientInterface
17
     */
18
    protected $akeneoPimClient;
19
20
    /**
21
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
22
     */
23
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient)
24
    {
25
        $this->akeneoPimClient = $akeneoPimClient;
26
    }
27
28
    /**
29
     * @param string $code Code of the resource
30
     *
31
     * @throws HttpException If the request failed.
32
     *
33
     * @return array
34
     */
35
    public function get(string $code): array
36
    {
37
        return $this->akeneoPimClient
38
            ->getProductDraftApi()
0 ignored issues
show
Bug introduced by
The method getProductDraftApi() does not exist on Akeneo\Pim\ApiClient\AkeneoPimClientInterface. Did you maybe mean getProductApi()? ( Ignorable by Annotation )

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

38
            ->/** @scrutinizer ignore-call */ getProductDraftApi()

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...
39
            ->get($code);
40
    }
41
}
42