AdExtensions   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 63
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 9 1
A delete() 0 9 1
A get() 0 9 1
1
<?php
2
/**
3
 * @author Dmitry Gladyshev <[email protected]>
4
 * @date 23/08/2016 15:16
5
 */
6
7
namespace Yandex\Direct\Service;
8
9
use Yandex\Direct\Exception\Exception;
10
use Yandex\Direct\Service;
11
use function Yandex\Direct\get_param_names;
12
13
/**
14
 * Class AdExtensions
15
 * @package Yandex\Direct\Service
16
 */
17
final class AdExtensions extends Service
18
{
19
    /**
20
     * Создает расширения.
21
     *
22
     * @param $AdExtensions
23
     * @return array
24
     * @throws Exception
25
     *
26
     * @see https://tech.yandex.ru/direct/doc/ref-v5/adextensions/add-docpage/
27
     */
28
    public function add($AdExtensions)
29
    {
30
        return $this->request([
31
            'method' => 'add',
32
            'params' => [
33
                'AdExtensions' => $AdExtensions
34
            ]
35
        ]);
36
    }
37
38
    /**
39
     * Удаляет расширения.
40
     *
41
     * @param $SelectionCriteria
42
     * @return array
43
     * @throws Exception
44
     *
45
     * @see https://tech.yandex.ru/direct/doc/ref-v5/adextensions/delete-docpage/
46
     */
47
    public function delete($SelectionCriteria)
48
    {
49
        return $this->request([
50
            'method' => 'delete',
51
            'params' => [
52
                'SelectionCriteria' => $SelectionCriteria
53
            ]
54
        ]);
55
    }
56
57
    /**
58
     * Возвращает расширения, отвечающие заданным критериям.
59
     *
60
     * @param $SelectionCriteria
61
     * @param $FieldNames
62
     * @param $CalloutFieldNames
63
     * @param $Page
64
     * @return array
65
     * @throws Exception
66
     * @throws \ReflectionException
67
     *
68
     * @see https://tech.yandex.ru/direct/doc/ref-v5/adextensions/get-docpage/
69
     */
70
    public function get($SelectionCriteria, $FieldNames, $CalloutFieldNames = null, $Page = null)
71
    {
72
        $params = compact(get_param_names(__METHOD__));
73
74
        return $this->request([
75
            'method' => 'get',
76
            'params' => $params
77
        ]);
78
    }
79
}
80