GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

BridgeFactory::getFilesystemBridge()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 11
nc 2
nop 4
crap 6
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  bthapaliya
6
 * @since:   2017-02-14
7
 */
8
9
10
namespace Chapi\Service\JobRepository;
11
12
use Chapi\Component\Cache\CacheInterface;
13
use Chapi\Component\RemoteClients\ApiClientInterface;
14
use Chapi\Service\JobValidator\JobValidatorServiceInterface;
15
use Psr\Log\LoggerInterface;
16
use Symfony\Component\Filesystem\Filesystem;
17
18
class BridgeFactory
19
{
20 View Code Duplication
    public static function getChronosBridge(
21
        ApiClientInterface $apiClient,
22
        CacheInterface $cache,
23
        JobValidatorServiceInterface $jobEntityValidatorService,
24
        LoggerInterface $logger
25
    ) {
26
        if ($apiClient->ping()) {
27
            return new BridgeChronos(
28
                $apiClient,
29
                $cache,
30
                $jobEntityValidatorService,
31
                $logger
32
            );
33
        }
34
35
        return new DummyBridge($logger);
36
    }
37
38 View Code Duplication
    public static function getMarathonBridge(
39
        ApiClientInterface $apiClient,
40
        CacheInterface $cache,
41
        JobValidatorServiceInterface $jobEntityValidatorService,
42
        LoggerInterface $logger
43
    ) {
44
        if ($apiClient->ping()) {
45
            return new BridgeMarathon(
46
                $apiClient,
47
                $cache,
48
                $jobEntityValidatorService,
49
                $logger
50
            );
51
        }
52
53
        return new DummyBridge($logger);
54
    }
55
56
57
    public static function getFilesystemBridge(
58
        Filesystem $fileSystemService,
59
        CacheInterface $cache,
60
        $repositoryDir,
61
        LoggerInterface $logger
62
    ) {
63
        if (empty($repositoryDir)) {
64
            return new DummyBridge($logger);
65
        }
66
67
        return new BridgeFileSystem(
68
            $fileSystemService,
69
            $cache,
70
            $repositoryDir
71
        );
72
    }
73
}
74