UserFacadeFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace DevBoardLib\GithubApiFacade\User;
4
5
use DevBoardLib\GithubApiFacade\Auth\GithubAccessToken;
6
use DevBoardLib\GithubApiFacade\Client\ClientFactory;
7
8
/**
9
 * Class UserFacadeFactory.
10
 */
11
class UserFacadeFactory
12
{
13
    private $clientFactory;
14
15
    /**
16
     * RepoFacadeFactory constructor.
17
     *
18
     * @param $clientFactory
19
     */
20
    public function __construct(ClientFactory $clientFactory)
21
    {
22
        $this->clientFactory = $clientFactory;
23
    }
24
25
    /**
26
     * @param GithubAccessToken $user
27
     *
28
     * @return PaginatedKnpLabsUserFacade
29
     */
30
    public function create(GithubAccessToken $user)
31
    {
32
        $client = $this->clientFactory->createTokenAuthenticatedClient($user);
33
34
        return new PaginatedKnpLabsUserFacade($client);
35
    }
36
}
37