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.

Factory::createUrlGenerators()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2.0054

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 8
cts 9
cp 0.8889
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 1
crap 2.0054
1
<?php
2
3
/*
4
 * This file is part of the composer-changelogs project.
5
 *
6
 * (c) Loïck Piera <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Pyrech\ComposerChangelogs;
13
14
use Pyrech\ComposerChangelogs\OperationHandler\OperationHandler;
15
use Pyrech\ComposerChangelogs\UrlGenerator\UrlGenerator;
16
17
class Factory
18
{
19
    /**
20
     * @return OperationHandler[]
21
     */
22 14
    public static function createOperationHandlers()
23
    {
24
        return [
25 14
            new \Pyrech\ComposerChangelogs\OperationHandler\InstallHandler(),
26 14
            new \Pyrech\ComposerChangelogs\OperationHandler\UpdateHandler(),
27 14
            new \Pyrech\ComposerChangelogs\OperationHandler\UninstallHandler(),
28 14
        ];
29
    }
30
31
    /**
32
     * @param string[] $gitlabHosts
33
     *
34
     * @return UrlGenerator[]
35
     */
36 14
    public static function createUrlGenerators(array $gitlabHosts = [])
37
    {
38
        $hosts = [
39 14
            new \Pyrech\ComposerChangelogs\UrlGenerator\GithubUrlGenerator(),
40 14
            new \Pyrech\ComposerChangelogs\UrlGenerator\BitbucketUrlGenerator(),
41 14
            new \Pyrech\ComposerChangelogs\UrlGenerator\WordPressUrlGenerator(),
42 14
        ];
43
44 14
        foreach ($gitlabHosts as $gitlabHost) {
45
            $hosts[] = new \Pyrech\ComposerChangelogs\UrlGenerator\GitlabUrlGenerator($gitlabHost);
46 14
        }
47
48 14
        return $hosts;
49
    }
50
51
    /**
52
     * @param string[] $gitlabHosts
53
     *
54
     * @return Outputter
55
     */
56 14
    public static function createOutputter(array $gitlabHosts = [])
57
    {
58 14
        return new Outputter(
59 14
            self::createOperationHandlers(),
60 14
            self::createUrlGenerators($gitlabHosts)
61 14
        );
62
    }
63
}
64