Completed
Push — master ( f77348...ad6f80 )
by Sergey
03:41
created

News::latest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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 News extends Provider
9
{
10
    protected $loginRequired = ['latest'];
11
12
    /**
13
     * Get user's latest news array
14
     *
15
     * @return array
16
     */
17
    public function latest()
18
    {
19
        $data = ["options" => ['allow_state' => true]];
20
        $query = Request::createQuery($data);
21
        $response = $this->request->exec(UrlHelper::RESOURCE_GET_LATEST_NEWS."?{$query}");
22
23
        return $this->response->getData($response);
24
    }
25
}
26