KnpLabsClientFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

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