PackageDist::setReference()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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 PackageDist
16
 *
17
 * @author Alexey Samara <[email protected]>
18
 * @package wow-apps/symfony-packagist
19
 */
20
class PackageDist
21
{
22
    /** @var string */
23
    private $type;
24
25
    /** @var string */
26
    private $url;
27
28
    /** @var string */
29
    private $reference;
30
31
    /** @var string */
32
    private $shasum;
33
34
    /**
35
     * PackageDist constructor.
36
     *
37
     * @param string $type
38
     * @param string $url
39
     * @param string $reference
40
     * @param string $shasum
41
     */
42
    public function __construct(string $type = '', string $url = '', string $reference = '', string $shasum = '')
43
    {
44
        $this
45
            ->setType($type)
46
            ->setUrl($url)
47
            ->setReference($reference)
48
            ->setShasum($shasum)
49
        ;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getType(): string
56
    {
57
        return $this->type;
58
    }
59
60
    /**
61
     * @param string $type
62
     * @return PackageDist
63
     */
64
    public function setType(string $type): PackageDist
65
    {
66
        $this->type = $type;
67
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getUrl(): string
74
    {
75
        return $this->url;
76
    }
77
78
    /**
79
     * @param string $url
80
     * @return PackageDist
81
     */
82
    public function setUrl(string $url): PackageDist
83
    {
84
        $this->url = $url;
85
        return $this;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getReference(): string
92
    {
93
        return $this->reference;
94
    }
95
96
    /**
97
     * @param string $reference
98
     * @return PackageDist
99
     */
100
    public function setReference(string $reference): PackageDist
101
    {
102
        $this->reference = $reference;
103
        return $this;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getShasum(): string
110
    {
111
        return $this->shasum;
112
    }
113
114
    /**
115
     * @param string $shasum
116
     * @return PackageDist
117
     */
118
    public function setShasum(string $shasum): PackageDist
119
    {
120
        $this->shasum = $shasum;
121
        return $this;
122
    }
123
}
124