1 | <?php |
||
10 | class Integration |
||
11 | { |
||
12 | use CreatesJwtTokens, AuthenticatesApplications, Macroable; |
||
13 | |||
14 | /** |
||
15 | * @var \Lcobucci\JWT\Token |
||
16 | */ |
||
17 | protected static $jwt; |
||
18 | |||
19 | /** |
||
20 | * @var GitHub |
||
21 | */ |
||
22 | protected $github; |
||
23 | |||
24 | /** |
||
25 | * Create a new Integration instance. |
||
26 | * |
||
27 | * @param GitHub|null $client |
||
28 | * |
||
29 | * @return void |
||
|
|||
30 | */ |
||
31 | public function __construct(GitHub $client = null) |
||
36 | |||
37 | /** |
||
38 | * Use am specific Client. |
||
39 | * |
||
40 | * @return self |
||
41 | */ |
||
42 | public function withClient(GitHub $client = null) : self |
||
48 | |||
49 | /** |
||
50 | * Authenticate as an application. |
||
51 | * |
||
52 | * @return self |
||
53 | */ |
||
54 | public function authenticate() : self |
||
60 | |||
61 | /** |
||
62 | * Authenticate as an installation. |
||
63 | * |
||
64 | * @param int $installation_id |
||
65 | * |
||
66 | * @return self |
||
67 | */ |
||
68 | public function asInstallation(int $installation_id) : self |
||
74 | |||
75 | /** |
||
76 | * Access the GitHub API. |
||
77 | * |
||
78 | * @param string $name |
||
79 | * |
||
80 | * @throws \Github\Exception\InvalidArgumentException |
||
81 | * |
||
82 | * @return \Github\Api\ApiInterface |
||
83 | */ |
||
84 | public function api(string $name) : \Github\Api\ApiInterface |
||
88 | } |
||
89 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.