Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
Author
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
8 / 8
8
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getEmail
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getCommitCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setCommitCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAdditionCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAdditionCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRemovalCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRemovalCount
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Jingga
4 *
5 * PHP Version 8.1
6 *
7 * @package   phpOMS\Utils\Git
8 * @copyright Dennis Eichhorn
9 * @license   OMS License 2.0
10 * @version   1.0.0
11 * @link      https://jingga.app
12 */
13declare(strict_types=1);
14
15namespace phpOMS\Utils\Git;
16
17/**
18 * Gray encoding class
19 *
20 * @package phpOMS\Utils\Git
21 * @license OMS License 2.0
22 * @link    https://jingga.app
23 * @since   1.0.0
24 */
25class Author
26{
27    /**
28     * Name.
29     *
30     * @var string
31     * @since 1.0.0
32     */
33    public string $name = '';
34
35    /**
36     * Email.
37     *
38     * @var string
39     * @since 1.0.0
40     */
41    private string $email = '';
42
43    /**
44     * Commit count.
45     *
46     * @var int
47     * @since 1.0.0
48     */
49    private int $commitCount = 0;
50
51    /**
52     * Additions count.
53     *
54     * @var int
55     * @since 1.0.0
56     */
57    private int $additionsCount = 0;
58
59    /**
60     * Removals count.
61     *
62     * @var int
63     * @since 1.0.0
64     */
65    private int $removalsCount = 0;
66
67    /**
68     * Constructor
69     *
70     * @param string $name  Author name
71     * @param string $email Author email
72     *
73     * @since 1.0.0
74     */
75    public function __construct(string $name = '', string $email = '')
76    {
77        $this->name  = $name;
78        $this->email = $email;
79    }
80
81    /**
82     * Get email
83     *
84     * @return string
85     *
86     * @since 1.0.0
87     */
88    public function getEmail() : string
89    {
90        return $this->email;
91    }
92
93    /**
94     * Get commit count
95     *
96     * @return int
97     *
98     * @since 1.0.0
99     */
100    public function getCommitCount() : int
101    {
102        return $this->commitCount;
103    }
104
105    /**
106     * Set commit count
107     *
108     * @param int $count Commit count
109     *
110     * @return void
111     *
112     * @since 1.0.0
113     */
114    public function setCommitCount(int $count) : void
115    {
116        $this->commitCount = $count;
117    }
118
119    /**
120     * Set additions count
121     *
122     * @param int $count Commit count
123     *
124     * @return void
125     *
126     * @since 1.0.0
127     */
128    public function setAdditionCount(int $count) : void
129    {
130        $this->additionsCount = $count;
131    }
132
133    /**
134     * Get additions count
135     *
136     * @return int
137     *
138     * @since 1.0.0
139     */
140    public function getAdditionCount() : int
141    {
142        return $this->additionsCount;
143    }
144
145    /**
146     * Set removals count
147     *
148     * @param int $count Commit count
149     *
150     * @return void
151     *
152     * @since 1.0.0
153     */
154    public function setRemovalCount(int $count) : void
155    {
156        $this->removalsCount = $count;
157    }
158
159    /**
160     * Get removals count
161     *
162     * @return int
163     *
164     * @since 1.0.0
165     */
166    public function getRemovalCount() : int
167    {
168        return $this->removalsCount;
169    }
170}