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

createTokenAuthenticatedClient()   A

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
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