Completed
Pull Request — master (#182)
by Sergey
03:28 queued 47s
created

Interests::getFeedRequestData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Providers;
4
5
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
6
use seregazhuk\PinterestBot\Api\Traits\HasTopics;
7
8
class Interests extends Provider
9
{
10
    use HasTopics;
11
12
    protected $feedUrl = UrlBuilder::RESOURCE_GET_CATEGORY_FEED;
13
14
    /**
15
     * Get list of main categories
16
     * 
17
     * @return array|bool
18
     */
19
    public function getMain()
20
    {
21
        return $this->execGetRequest(["category_types" => "main"], UrlBuilder::RESOURCE_GET_CATEGORIES);
22
    }
23
24
    /**
25
     * Get category info
26
     *
27
     * @param string $category
28
     * @return array|bool
29
     */
30
    public function getInfo($category)
31
    {
32
        return $this->execGetRequest(["category" => $category], UrlBuilder::RESOURCE_GET_CATEGORY);
33
    }
34
35
    /**
36
     * @param $interest
37
     * @return array
38
     */
39
    protected function getFeedRequestData($interest)
40
    {
41
        return [
42
            'feed'             => $interest,
43
            'is_category_feed' => true,
44
        ];
45
    }
46
}
47