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

RepoFacadeFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace DevBoardLib\GithubApiFacade\Repo;
3
4
use DevBoardLib\GithubApiFacade\Auth\GithubAccessToken;
5
use DevBoardLib\GithubApiFacade\Client\ClientFactory;
6
use DevBoardLib\GithubCore\Repo\GithubRepo;
7
8
/**
9
 * Class RepoFacadeFactory.
10
 */
11
class RepoFacadeFactory
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 GithubRepo        $githubRepo
27
     * @param GithubAccessToken $user
28
     *
29
     * @return PaginatedKnpLabsRepoFacade
30
     */
31
    public function create(GithubRepo $githubRepo, GithubAccessToken $user)
32
    {
33
        $client = $this->clientFactory->createTokenAuthenticatedClient($user);
34
35
        return new PaginatedKnpLabsRepoFacade($client, $githubRepo);
36
    }
37
}
38