Completed
Push — master ( f63129...3a8a63 )
by Sergey
03:49
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
     *
15
     * @return array
16
     */
17
    public function latest()
18
    {
19
        $this->request->checkLoggedIn();
20
21
        $data = ["options" => ['allow_state' => true]];
22
        $request = Request::createRequestData($data);
23
24
        $getString = UrlHelper::buildRequestString($request);
25
        $response = $this->request->exec(UrlHelper::RESOURCE_GET_LATEST_NEWS."?{$getString}");
26
27
        return $this->response->getData($response);
28
    }
29
}
30