1 | <?php |
||
33 | class Tag extends NodeObject |
||
34 | { |
||
35 | /** |
||
36 | * tag name |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | private $name; |
||
|
|||
41 | |||
42 | /** |
||
43 | * full reference |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | private $fullRef; |
||
48 | |||
49 | /** |
||
50 | * sha |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | private $sha; |
||
55 | |||
56 | /** |
||
57 | * Creates a new tag on the repository and returns it |
||
58 | * |
||
59 | * @param \GitElephant\Repository $repository repository instance |
||
60 | * @param string $name branch name |
||
61 | * @param string $startPoint branch to start from |
||
62 | * @param string $message tag message |
||
63 | * |
||
64 | * @throws \RuntimeException |
||
65 | * @return \GitElephant\Objects\Tag |
||
66 | */ |
||
67 | 27 | public static function create( |
|
79 | |||
80 | /** |
||
81 | * static generator to generate a single commit from output of command.show service |
||
82 | * |
||
83 | * @param \GitElephant\Repository $repository repository |
||
84 | * @param array $outputLines output lines |
||
85 | * @param string $name name |
||
86 | * |
||
87 | * @throws \RuntimeException |
||
88 | * @throws \InvalidArgumentException |
||
89 | * @throws \Symfony\Component\Process\Exception\RuntimeException |
||
90 | * @return Tag |
||
91 | */ |
||
92 | public static function createFromOutputLines( |
||
102 | |||
103 | /** |
||
104 | * Class constructor |
||
105 | * |
||
106 | * @param \GitElephant\Repository $repository repository instance |
||
107 | * @param string $name name |
||
108 | * |
||
109 | * @throws \RuntimeException |
||
110 | * @throws \InvalidArgumentException |
||
111 | * @internal param string $line a single tag line from the git binary |
||
112 | */ |
||
113 | 27 | public function __construct(Repository $repository, string $name) |
|
120 | |||
121 | /** |
||
122 | * factory method |
||
123 | * |
||
124 | * @param \GitElephant\Repository $repository repository instance |
||
125 | * @param string $name name |
||
126 | * |
||
127 | * @return \GitElephant\Objects\Tag |
||
128 | */ |
||
129 | 1 | public static function pick(Repository $repository, string $name): \GitElephant\Objects\Tag |
|
133 | |||
134 | /** |
||
135 | * deletes the tag |
||
136 | */ |
||
137 | 1 | public function delete(): void |
|
143 | |||
144 | /** |
||
145 | * get the commit properties from command |
||
146 | * |
||
147 | * @see ShowCommand::commitInfo |
||
148 | */ |
||
149 | 27 | private function createFromCommand(): void |
|
155 | |||
156 | /** |
||
157 | * parse the output of a git command showing a commit |
||
158 | * |
||
159 | * @param array $outputLines output lines |
||
160 | * |
||
161 | * @throws \RuntimeException |
||
162 | * @throws \Symfony\Component\Process\Exception\InvalidArgumentException |
||
163 | * @throws \Symfony\Component\Process\Exception\LogicException |
||
164 | * @throws \InvalidArgumentException |
||
165 | * @throws \Symfony\Component\Process\Exception\RuntimeException |
||
166 | * @return void |
||
167 | */ |
||
168 | 27 | private function parseOutputLines(array $outputLines) |
|
186 | |||
187 | /** |
||
188 | * toString magic method |
||
189 | * |
||
190 | * @return string the sha |
||
191 | */ |
||
192 | public function __toString(): string |
||
196 | |||
197 | /** |
||
198 | * @return CallerInterface |
||
199 | */ |
||
200 | 27 | private function getCaller(): CallerInterface |
|
204 | |||
205 | /** |
||
206 | * name getter |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | 3 | public function getName(): string |
|
214 | |||
215 | /** |
||
216 | * fullRef getter |
||
217 | * |
||
218 | * @return string |
||
219 | */ |
||
220 | 27 | public function getFullRef(): string |
|
224 | |||
225 | /** |
||
226 | * sha setter |
||
227 | * |
||
228 | * @param string $sha sha |
||
229 | */ |
||
230 | 27 | public function setSha(string $sha): void |
|
234 | |||
235 | /** |
||
236 | * sha getter |
||
237 | * |
||
238 | * @return string |
||
239 | */ |
||
240 | 4 | public function getSha(): string |
|
244 | } |
||
245 |