Completed
Pull Request — master (#139)
by
unknown
04:18
created

OfferClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 10 1
1
<?php
2
/**
3
 * Yandex PHP Library
4
 *
5
 * @copyright NIX Solutions Ltd.
6
 * @link      https://github.com/nixsolutions/yandex-php-library
7
 */
8
9
/**
10
 * @namespace
11
 */
12
namespace Yandex\Market\Content\Clients;
13
14
use Yandex\Market\Content\ContentClient;
15
use Yandex\Market\Content\Models;
16
17
/**
18
 * Class OfferClient
19
 *
20
 * @category Yandex
21
 * @package  MarketContent
22
 *
23
 * @author  Oleg Scherbakov <[email protected]>
24
 * @created 08.01.16 02:10
25
 */
26
class OfferClient extends ContentClient
27
{
28
    /**
29
     * Get offer information
30
     *
31
     * Returns offer of Yandex.Market service according to params.
32
     *
33
     * @see https://tech.yandex.ru/market/content-data/doc/dg/reference/offer-id-docpage/
34
     *
35
     * @param string $offerId
36
     * @param array  $params
37
     *
38
     * @return Models\ResponseOfferGet
39
     */
40 1
    public function get($offerId, $params = array())
41
    {
42 1
        $resource = 'offer/' . $offerId . '.json';
43 1
        $resource .= '?' . $this->buildQueryString($params);
44 1
        $response = $this->getServiceResponse($resource);
45
46 1
        $getOfferResponse = new Models\ResponseOfferGet($response);
47
48 1
        return $getOfferResponse;
49
    }
50
}
51