Completed
Push — master ( 99f756...c85930 )
by Sergey
03:21
created

News::latest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
rs 9.4285
cc 1
eloc 7
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
     * @return array
15
     */
16
    public function latest()
17
    {
18
        $this->request->checkLoggedIn();
19
20
        $data = ["options" => ['allow_state' => true]];
21
        $request = Request::createRequestData($data);
22
23
        $getString = UrlHelper::buildRequestString($request);
24
        $response = $this->request->exec(UrlHelper::RESOURCE_GET_LATEST_NEWS . "?{$getString}");
25
26
        return $this->response->getData($response);
27
    }
28
}
29