1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Quantum\Hub\Entity; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* @class Repository |
9
|
|
|
* @package Quantum\Hub\Entity |
10
|
|
|
*/ |
11
|
|
|
class Repository extends BaseEntity |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* The name |
15
|
|
|
* @var string |
16
|
|
|
*/ |
17
|
|
|
protected string $name = ''; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* The full name (with format organization/repository) |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
protected string $fullName = ''; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* The repository description |
27
|
|
|
* @var string|null |
28
|
|
|
*/ |
29
|
|
|
protected ?string $description = null; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Whether is private repository |
33
|
|
|
* @var bool |
34
|
|
|
*/ |
35
|
|
|
protected bool $private = false; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The HTML URL |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
protected string $htmlUrl = ''; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* The size of the repository in byte |
45
|
|
|
* @var int |
46
|
|
|
*/ |
47
|
|
|
protected int $size = 0; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* The created at timestamp |
51
|
|
|
* @var int |
52
|
|
|
*/ |
53
|
|
|
protected int $createdAt = 0; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* The updated time |
57
|
|
|
* @var string |
58
|
|
|
*/ |
59
|
|
|
protected string $updatedAt = ''; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* The visibility of this repository |
63
|
|
|
* @var string |
64
|
|
|
*/ |
65
|
|
|
protected string $visibility = ''; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* The repository organization name |
69
|
|
|
* @var string |
70
|
|
|
*/ |
71
|
|
|
protected string $organization = ''; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
|
|
public function getName(): string |
78
|
|
|
{ |
79
|
|
|
return $this->name; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* |
84
|
|
|
* @return string |
85
|
|
|
*/ |
86
|
|
|
public function getFullName(): string |
87
|
|
|
{ |
88
|
|
|
return $this->fullName; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* |
93
|
|
|
* @return string|null |
94
|
|
|
*/ |
95
|
|
|
public function getDescription(): ?string |
96
|
|
|
{ |
97
|
|
|
return $this->description; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* |
102
|
|
|
* @return bool |
103
|
|
|
*/ |
104
|
|
|
public function isPrivate(): bool |
105
|
|
|
{ |
106
|
|
|
return $this->private; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* |
111
|
|
|
* @return string |
112
|
|
|
*/ |
113
|
|
|
public function getHtmlUrl(): string |
114
|
|
|
{ |
115
|
|
|
return $this->htmlUrl; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* |
120
|
|
|
* @return int |
121
|
|
|
*/ |
122
|
|
|
public function getSize(): int |
123
|
|
|
{ |
124
|
|
|
return $this->size; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* |
129
|
|
|
* @return int |
130
|
|
|
*/ |
131
|
|
|
public function getCreatedAt(): int |
132
|
|
|
{ |
133
|
|
|
return $this->createdAt; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* |
138
|
|
|
* @return string |
139
|
|
|
*/ |
140
|
|
|
public function getUpdatedAt(): string |
141
|
|
|
{ |
142
|
|
|
return $this->updatedAt; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* |
147
|
|
|
* @return string |
148
|
|
|
*/ |
149
|
|
|
public function getVisibility(): string |
150
|
|
|
{ |
151
|
|
|
return $this->visibility; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* |
156
|
|
|
* @return string |
157
|
|
|
*/ |
158
|
|
|
public function getOrganization(): string |
159
|
|
|
{ |
160
|
|
|
return $this->organization; |
161
|
|
|
} |
162
|
|
|
} |
163
|
|
|
|