Completed
Pull Request — master (#131)
by Sergey
03:08
created

Interests   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMain() 0 4 1
A getInfo() 0 4 1
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