Completed
Push — master ( b86db6...b3547a )
by Sergey
39s
created

HasRelatedTopics::getRelatedTopics()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Traits;
4
5
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
6
7
trait HasRelatedTopics
8
{
9
    /**
10
     * Returns a list of related interests
11
     * @param string $interest
12
     * @return array|bool
13
     */
14
    public function getRelatedTopics($interest)
15
    {
16
        return $this->execGetRequest(
17
            [
18
                'interest_name' => $interest,
19
            ],
20
            UrlBuilder::RESOURCE_GET_CATEGORIES_RELATED
21
        );
22
    }
23
24
    /**
25
     * Executes a GET request to Pinterest API.
26
     *
27
     * @param array $requestOptions
28
     * @param string $resourceUrl
29
     * @return array|bool
30
     */
31
    abstract protected function execGetRequest(array $requestOptions = [], $resourceUrl = '');
32
}