createTokenAuthenticatedClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 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