Completed
Pull Request — master (#19)
by Sergey
03:17
created

Interests::follow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 11
loc 11
rs 9.4286
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Providers;
4
5
use seregazhuk\PinterestBot\Api\Request;
6
use seregazhuk\PinterestBot\Helpers\UrlHelper;
7
8
class Interests extends Provider
9
{
10
    /**
11
     * Follow interest by ID
12
     *
13
     * @param int $interestId
14
     * @return bool
15
     */
16 View Code Duplication
    public function follow($interestId)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $this->request->checkLoggedIn();
19
20
        $response = $this->request->followMethodCall(
21
            $interestId,
22
            Request::INTEREST_ENTITY_ID,
23
            UrlHelper::RESOURCE_FOLLOW_INTEREST
24
        );
25
        return $this->response->checkResponse($response);
26
    }
27
28
    /**
29
     * Unfollow interest by ID
30
     *
31
     * @param int $interestId
32
     * @return bool
33
     */
34 View Code Duplication
    public function unFollow($interestId)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
35
    {
36
        $this->request->checkLoggedIn();
37
38
        $response = $this->request->followMethodCall(
39
            $interestId,
40
            Request::INTEREST_ENTITY_ID,
41
            UrlHelper::RESOURCE_UNFOLLOW_INTEREST
42
        );
43
        return $this->response->checkResponse($response);
44
    }
45
}
46