PackageSource   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 0
loc 81
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getType() 0 4 1
A setType() 0 5 1
A getUrl() 0 4 1
A setUrl() 0 5 1
A getReference() 0 4 1
A setReference() 0 5 1
1
<?php
2
/**
3
 * This file is part of the wow-apps/symfony-packagist project
4
 * https://github.com/wow-apps/symfony-packagist
5
 *
6
 * (c) 2017 WoW-Apps
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 WowApps\PackagistBundle\DTO;
13
14
/**
15
 * Class PackageSource
16
 *
17
 * @author Alexey Samara <[email protected]>
18
 * @package wow-apps/symfony-packagist
19
 */
20
class PackageSource
21
{
22
    /** @var string */
23
    private $type;
24
25
    /** @var string */
26
    private $url;
27
28
    /** @var string */
29
    private $reference;
30
31
    /**
32
     * PackageSource constructor.
33
     *
34
     * @param string $type
35
     * @param string $url
36
     * @param string $reference
37
     */
38
    public function __construct(string $type = '', string $url = '', string $reference = '')
39
    {
40
        $this
41
            ->setType($type)
42
            ->setUrl($url)
43
            ->setReference($reference)
44
        ;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getType(): string
51
    {
52
        return $this->type;
53
    }
54
55
    /**
56
     * @param string $type
57
     * @return PackageSource
58
     */
59
    public function setType(string $type): PackageSource
60
    {
61
        $this->type = $type;
62
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getUrl(): string
69
    {
70
        return $this->url;
71
    }
72
73
    /**
74
     * @param string $url
75
     * @return PackageSource
76
     */
77
    public function setUrl(string $url): PackageSource
78
    {
79
        $this->url = $url;
80
        return $this;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getReference(): string
87
    {
88
        return $this->reference;
89
    }
90
91
    /**
92
     * @param string $reference
93
     * @return PackageSource
94
     */
95
    public function setReference(string $reference): PackageSource
96
    {
97
        $this->reference = $reference;
98
        return $this;
99
    }
100
}
101