Completed
Pull Request — master (#168)
by Sergey
03:10
created

News::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace seregazhuk\PinterestBot\Api\Providers;
4
5
use seregazhuk\PinterestBot\Helpers\UrlBuilder;
6
7
class News extends Provider
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $loginRequiredFor = ['last', 'all'];
13
14
    /**
15
     * Get user's latest news array.
16
     * @deprecated 4.11.0
17
     *
18
     * @param $limit
19
     * @return mixed
20
     */
21
    public function last($limit = 0)
22
    {
23
        return $this->all($limit);
24
    }
25
26
    /**
27
     * @param int $limit
28
     * @return mixed
29
     */
30 View Code Duplication
    public function all($limit = 0)
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...
31
    {
32
        $params = [
33
            'data' => ['allow_stale' => true],
34
            'url'  => UrlBuilder::RESOURCE_GET_LATEST_NEWS
35
        ];
36
37
        return $this->getPaginatedResponse($params, $limit);
38
    }
39
}
40