Completed
Push — master ( ddd190...4c5428 )
by Dmitry
02:35
created

TurboPages::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
/**
3
 * @project yandex-direct-client
4
 */
5
6
namespace Yandex\Direct\Service;
7
8
use DOMDocument;
9
use Throwable;
10
use Yandex\Direct\Exception\ErrorResponseException;
11
use Yandex\Direct\Exception\Exception;
12
use Yandex\Direct\Service;
13
14
/**
15
 * Class TurboPages
16
 *
17
 * @author Dmitry Gladyshev <[email protected]>
18
 * @since 2.5
19
 */
20
final class TurboPages extends Service
21
{
22
    /**
23
     * @param array $SelectionCriteria
24
     * @param array $FieldNames
25
     * @param array|null $Page
26
     * @return array|DOMDocument
27
     * @throws Throwable
28
     * @throws ErrorResponseException
29
     * @throws Exception
30
     * @see https://tech.yandex.ru/direct/doc/ref-v5/turbopages/get-docpage/
31
     */
32
    public function get($SelectionCriteria, $FieldNames, $Page = null)
33
    {
34
        $params = array_filter([
35
            'SelectionCriteria' => $SelectionCriteria,
36
            'FieldNames' => $FieldNames,
37
            'Page' => $Page
38
        ]);
39
40
        return $this->request([
41
            'method' => 'get',
42
            'params' => $params
43
        ]);
44
    }
45
}
46