Completed
Pull Request — master (#131)
by Sergey
03:45 queued 01:16
created

Interests::getMain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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