Ad   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 1
f 0
dl 0
loc 31
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAds() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Promopult\TikTokMarketingApi\Service;
6
7
use Throwable;
8
9
/**
10
 * @psalm-suppress UnusedClass
11
 */
12
final class Ad extends \Promopult\TikTokMarketingApi\AbstractService
13
{
14
    /**
15
     * Get ads
16
     *
17
     * @param int $advertiserId
18
     * @param ?array $fields
19
     * @param ?array $filtering
20
     * @param ?int $page
21
     * @param ?int $pageSize
22
     *
23
     * @return array
24
     *
25
     * @throws Throwable
26
     */
27
    public function getAds(
28
        int $advertiserId,
29
        ?array $fields = null,
30
        ?array $filtering = null,
31
        ?int $page = null,
32
        ?int $pageSize = null
33
    ): array {
34
        return $this->requestApi(
35
            'GET',
36
            '/open_api/v1.3/ad/get/',
37
            [
38
                'advertiser_id' => $advertiserId,
39
                'fields' => $fields,
40
                'filtering' => $filtering,
41
                'page' => $page,
42
                'page_size' => $pageSize
43
            ]
44
        );
45
    }
46
}
47