PaginatedKnpLabsUserFacade   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fetchAllAccessibleRepos() 0 4 1
A getMeApi() 0 4 1
1
<?php
2
3
namespace DevBoardLib\GithubApiFacade\User;
4
5
use Github\Client;
6
use Github\ResultPager;
7
8
/**
9
 * Class PaginatedKnpLabsUserFacade.
10
 */
11
class PaginatedKnpLabsUserFacade implements UserFacade
12
{
13
    /** @var  Client */
14
    private $client;
15
    /** @var ResultPager */
16
    private $paginator;
17
18
    /**
19
     * PaginatedKnpLabsUserFacade constructor.
20
     *
21
     * @param Client $client
22
     */
23
    public function __construct(Client $client)
24
    {
25
        $this->client    = $client;
26
        $this->paginator = new ResultPager($this->client);
27
    }
28
29
    /**
30
     * @return array|mixed
31
     */
32
    public function fetchAllAccessibleRepos()
33
    {
34
        return $this->paginator->fetchAll($this->getMeApi(), 'repositories', ['type' => 'all']);
35
    }
36
37
    /**
38
     * @return \Github\Api\ApiInterface
39
     */
40
    private function getMeApi()
41
    {
42
        return $this->client->api('me');
43
    }
44
}
45