GitHubStat::setWatchers()   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 GitHubStat
16
 *
17
 * @author Alexey Samara <[email protected]>
18
 * @package wow-apps/symfony-packagist
19
 */
20
class GitHubStat
21
{
22
    /** @var int */
23
    private $stars;
24
25
    /** @var int */
26
    private $watchers;
27
28
    /** @var int */
29
    private $forks;
30
31
    /** @var int */
32
    private $openIssues;
33
34
    /**
35
     * GitHubStat constructor.
36
     *
37
     * @param int $stars
38
     * @param int $watchers
39
     * @param int $forks
40
     * @param int $openIssues
41
     */
42
    public function __construct(int $stars = 0, int $watchers = 0, int $forks = 0, int $openIssues = 0)
43
    {
44
        $this
45
            ->setStars($stars)
46
            ->setWatchers($watchers)
47
            ->setForks($forks)
48
            ->setOpenIssues($openIssues)
49
        ;
50
    }
51
52
    /**
53
     * @return int
54
     */
55
    public function getStars(): int
56
    {
57
        return $this->stars;
58
    }
59
60
    /**
61
     * @param int $stars
62
     * @return GitHubStat
63
     */
64
    public function setStars(int $stars): GitHubStat
65
    {
66
        $this->stars = $stars;
67
        return $this;
68
    }
69
70
    /**
71
     * @return int
72
     */
73
    public function getWatchers(): int
74
    {
75
        return $this->watchers;
76
    }
77
78
    /**
79
     * @param int $watchers
80
     * @return GitHubStat
81
     */
82
    public function setWatchers(int $watchers): GitHubStat
83
    {
84
        $this->watchers = $watchers;
85
        return $this;
86
    }
87
88
    /**
89
     * @return int
90
     */
91
    public function getForks(): int
92
    {
93
        return $this->forks;
94
    }
95
96
    /**
97
     * @param int $forks
98
     * @return GitHubStat
99
     */
100
    public function setForks(int $forks): GitHubStat
101
    {
102
        $this->forks = $forks;
103
        return $this;
104
    }
105
106
    /**
107
     * @return int
108
     */
109
    public function getOpenIssues(): int
110
    {
111
        return $this->openIssues;
112
    }
113
114
    /**
115
     * @param int $openIssues
116
     * @return GitHubStat
117
     */
118
    public function setOpenIssues(int $openIssues): GitHubStat
119
    {
120
        $this->openIssues = $openIssues;
121
        return $this;
122
    }
123
}
124