Completed
Push — master ( f63129...3a8a63 )
by Sergey
03:49
created

News   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 1
cbo 5
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A latest() 0 12 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 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