Completed
Push — master ( ae399a...84a10b )
by Miro
05:50
created

KnpLabsClientFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createTokenAuthenticatedClient() 0 7 1
A createUnauthenticatedClient() 0 6 1
1
<?php
2
namespace DevBoardLib\GithubApiFacade\Client;
3
4
use DevBoardLib\GithubApiFacade\Auth\GithubAccessToken;
5
use Github\Client;
6
7
/**
8
 * Class KnpLabsClientFactory.
9
 */
10
class KnpLabsClientFactory implements ClientFactory
11
{
12
    /**
13
     * @param GithubAccessToken $user
14
     *
15
     * @return Client
16
     */
17
    public function createTokenAuthenticatedClient(GithubAccessToken $user)
18
    {
19
        $client = new Client();
20
        $client->authenticate($user->getGithubAccessToken(), 'null', 'url_token');
21
22
        return $client;
23
    }
24
25
    /**
26
     * @return Client
27
     */
28
    public function createUnauthenticatedClient()
29
    {
30
        $client = new Client();
31
32
        return $client;
33
    }
34
}
35