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

HasRelatedTopics   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 26
c 1
b 0
f 1
wmc 1
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRelatedTopics() 0 9 1
execGetRequest() 0 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
}