CustomSourceResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A resolveForPackage() 0 3 1
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerChangelogs\Resolvers\Url;
7
8
class CustomSourceResolver implements \Vaimo\ComposerChangelogs\Interfaces\UrlResolverInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $customUrl;
14
15
    /**
16
     * @var \Vaimo\ComposerChangelogs\Normalizers\UrlNormalizer
17
     */
18
    private $urlNormalizer;
19
20
    /**
21
     * @param string $customUrl
22
     */
23
    public function __construct(
24
        $customUrl
25
    ) {
26
        $this->customUrl = $customUrl;
27
28
        $this->urlNormalizer = new \Vaimo\ComposerChangelogs\Normalizers\UrlNormalizer();
29
    }
30
31
    public function resolveForPackage(\Composer\Package\PackageInterface $package)
32
    {
33
        return $this->urlNormalizer->assureHttpAccessibility($this->customUrl);
34
    }
35
}
36