| @@ 18-123 (lines=106) @@ | ||
| 15 | * ) |
|
| 16 | * @EmptyResource("Git\EmptyCommit") |
|
| 17 | */ |
|
| 18 | abstract class Commit extends AbstractResource implements CommitInterface |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | protected $sha; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | protected $url; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @var User |
|
| 32 | */ |
|
| 33 | protected $author; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @var User |
|
| 37 | */ |
|
| 38 | protected $comitter; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @var string |
|
| 42 | */ |
|
| 43 | protected $message; |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @var Tree |
|
| 47 | */ |
|
| 48 | protected $tree; |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @var int |
|
| 52 | */ |
|
| 53 | protected $comment_count; |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @var string |
|
| 57 | */ |
|
| 58 | protected $protection_url; |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function sha(): string |
|
| 64 | { |
|
| 65 | return $this->sha; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @return string |
|
| 70 | */ |
|
| 71 | public function url(): string |
|
| 72 | { |
|
| 73 | return $this->url; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @return User |
|
| 78 | */ |
|
| 79 | public function author(): User |
|
| 80 | { |
|
| 81 | return $this->author; |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * @return User |
|
| 86 | */ |
|
| 87 | public function comitter(): User |
|
| 88 | { |
|
| 89 | return $this->comitter; |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * @return string |
|
| 94 | */ |
|
| 95 | public function message(): string |
|
| 96 | { |
|
| 97 | return $this->message; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * @return TreeInterface |
|
| 102 | */ |
|
| 103 | public function tree(): TreeInterface |
|
| 104 | { |
|
| 105 | return $this->tree; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * @return int |
|
| 110 | */ |
|
| 111 | public function commentCount(): int |
|
| 112 | { |
|
| 113 | return $this->comment_count; |
|
| 114 | } |
|
| 115 | ||
| 116 | /** |
|
| 117 | * @return string |
|
| 118 | */ |
|
| 119 | public function protectionUrl(): string |
|
| 120 | { |
|
| 121 | return $this->protection_url; |
|
| 122 | } |
|
| 123 | } |
|
| 124 | ||
| @@ 24-116 (lines=93) @@ | ||
| 21 | * ) |
|
| 22 | * @EmptyResource("Repository\EmptyCommit") |
|
| 23 | */ |
|
| 24 | abstract class Commit extends AbstractResource implements CommitInterface |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * @var string |
|
| 28 | */ |
|
| 29 | protected $url; |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @var string |
|
| 33 | */ |
|
| 34 | protected $sha; |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @var string |
|
| 38 | */ |
|
| 39 | protected $html_url; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @var GitCommitInterface |
|
| 43 | */ |
|
| 44 | protected $commit; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @var UserInterface |
|
| 48 | */ |
|
| 49 | protected $author; |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @var UserInterface |
|
| 53 | */ |
|
| 54 | protected $comitter; |
|
| 55 | ||
| 56 | /** |
|
| 57 | * @var TreeInterface |
|
| 58 | */ |
|
| 59 | protected $parents; |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @return string |
|
| 63 | */ |
|
| 64 | public function url(): string |
|
| 65 | { |
|
| 66 | return $this->url; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * @return string |
|
| 71 | */ |
|
| 72 | public function sha(): string |
|
| 73 | { |
|
| 74 | return $this->sha; |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * @return string |
|
| 79 | */ |
|
| 80 | public function htmlUrl(): string |
|
| 81 | { |
|
| 82 | return $this->html_url; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @return GitCommitInterface |
|
| 87 | */ |
|
| 88 | public function commit(): GitCommitInterface |
|
| 89 | { |
|
| 90 | return $this->commit; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * @return UserInterface |
|
| 95 | */ |
|
| 96 | public function author(): UserInterface |
|
| 97 | { |
|
| 98 | return $this->author; |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * @return UserInterface |
|
| 103 | */ |
|
| 104 | public function comitter(): UserInterface |
|
| 105 | { |
|
| 106 | return $this->comitter; |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| 110 | * @return TreeInterface |
|
| 111 | */ |
|
| 112 | public function parents(): TreeInterface |
|
| 113 | { |
|
| 114 | return $this->parents; |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||