| 1 | <?php |
||
| 5 | class Github extends AbstractOrigin implements OriginInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The name of the origin. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | public $name = 'Github'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Determines whether or not the Request originated from Github. |
||
| 16 | * |
||
| 17 | * @return bool Returns true if the request originated from Github. False otherwise. |
||
| 18 | */ |
||
| 19 | 18 | public function isOrigin() |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Verifies the authenticity of a webhook request from Github. |
||
| 31 | * |
||
| 32 | * Follows the procedure described here: https://developer.github.com/webhooks/securing/ |
||
| 33 | * |
||
| 34 | * @return bool Returns true if the request is authentic. False otherwise. |
||
|
1 ignored issue
–
show
|
|||
| 35 | */ |
||
| 36 | 4 | public function isAuthentic() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Gets the event the triggered the webhook request. |
||
| 50 | * |
||
| 51 | * @return string The name of the event, e.g. push, release, create, etc. |
||
| 52 | */ |
||
| 53 | 2 | public function event() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * Gets the URL to be cloned from. |
||
| 60 | * |
||
| 61 | * @return string The URL of the repo. |
||
| 62 | */ |
||
| 63 | 36 | public function getRepoUrl() |
|
| 67 | |||
| 68 | /** |
||
| 69 | * Gets the ID of the commit that is to be cloned. |
||
| 70 | * |
||
| 71 | * @return string The commit ID. |
||
| 72 | */ |
||
| 73 | 36 | public function getCommitId() |
|
| 77 | } |
||
| 78 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.