@@ -12,51 +12,51 @@ |
||
12 | 12 | class Emails extends AbstractUsers |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * List email addresses for a user |
|
17 | - * |
|
18 | - * @link https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user |
|
19 | - * @return array |
|
20 | - * @throws \Exception |
|
21 | - */ |
|
22 | - public function listEmailAddresses(): array |
|
23 | - { |
|
24 | - return $this->getApi()->request($this->getApi()->sprintf('/user/emails')); |
|
25 | - } |
|
15 | + /** |
|
16 | + * List email addresses for a user |
|
17 | + * |
|
18 | + * @link https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user |
|
19 | + * @return array |
|
20 | + * @throws \Exception |
|
21 | + */ |
|
22 | + public function listEmailAddresses(): array |
|
23 | + { |
|
24 | + return $this->getApi()->request($this->getApi()->sprintf('/user/emails')); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Add email address(es) |
|
29 | - * |
|
30 | - * @link https://developer.github.com/v3/users/emails/#add-email-addresses |
|
31 | - * |
|
32 | - * @param array $addresses |
|
33 | - * |
|
34 | - * @return array |
|
35 | - * @throws \Exception |
|
36 | - */ |
|
37 | - public function addEmailAddress(array $addresses = []): array |
|
38 | - { |
|
39 | - return $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_POST, $addresses); |
|
40 | - } |
|
27 | + /** |
|
28 | + * Add email address(es) |
|
29 | + * |
|
30 | + * @link https://developer.github.com/v3/users/emails/#add-email-addresses |
|
31 | + * |
|
32 | + * @param array $addresses |
|
33 | + * |
|
34 | + * @return array |
|
35 | + * @throws \Exception |
|
36 | + */ |
|
37 | + public function addEmailAddress(array $addresses = []): array |
|
38 | + { |
|
39 | + return $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_POST, $addresses); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Delete email address(es) |
|
44 | - * |
|
45 | - * @link https://developer.github.com/v3/users/emails/#delete-email-addresses |
|
46 | - * |
|
47 | - * @param array $addresses |
|
48 | - * |
|
49 | - * @return bool |
|
50 | - * @throws \Exception |
|
51 | - */ |
|
52 | - public function deleteEmailAddress(array $addresses = []): bool |
|
53 | - { |
|
54 | - $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_DELETE, $addresses); |
|
42 | + /** |
|
43 | + * Delete email address(es) |
|
44 | + * |
|
45 | + * @link https://developer.github.com/v3/users/emails/#delete-email-addresses |
|
46 | + * |
|
47 | + * @param array $addresses |
|
48 | + * |
|
49 | + * @return bool |
|
50 | + * @throws \Exception |
|
51 | + */ |
|
52 | + public function deleteEmailAddress(array $addresses = []): bool |
|
53 | + { |
|
54 | + $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_DELETE, $addresses); |
|
55 | 55 | |
56 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
57 | - return true; |
|
58 | - } |
|
56 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
57 | + return true; |
|
58 | + } |
|
59 | 59 | |
60 | - return false; |
|
61 | - } |
|
60 | + return false; |
|
61 | + } |
|
62 | 62 | } |
@@ -12,75 +12,75 @@ |
||
12 | 12 | class PublicKeys extends AbstractUsers |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * List public keys for a user |
|
17 | - * |
|
18 | - * @link https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user |
|
19 | - * |
|
20 | - * @param string $username |
|
21 | - * |
|
22 | - * @return array |
|
23 | - * @throws \Exception |
|
24 | - */ |
|
25 | - public function listUserPublicKeys(string $username): array |
|
26 | - { |
|
27 | - return $this->getApi()->request($this->getApi()->sprintf('/users/:username/keys', $username)); |
|
28 | - } |
|
15 | + /** |
|
16 | + * List public keys for a user |
|
17 | + * |
|
18 | + * @link https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user |
|
19 | + * |
|
20 | + * @param string $username |
|
21 | + * |
|
22 | + * @return array |
|
23 | + * @throws \Exception |
|
24 | + */ |
|
25 | + public function listUserPublicKeys(string $username): array |
|
26 | + { |
|
27 | + return $this->getApi()->request($this->getApi()->sprintf('/users/:username/keys', $username)); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * List your public keys |
|
32 | - * |
|
33 | - * @link https://developer.github.com/v3/users/keys/#list-your-public-keys |
|
34 | - * @return array |
|
35 | - * @throws \Exception |
|
36 | - */ |
|
37 | - public function listYourPublicKeys(): array |
|
38 | - { |
|
39 | - return $this->getApi()->request($this->getApi()->sprintf('/user/keys')); |
|
40 | - } |
|
30 | + /** |
|
31 | + * List your public keys |
|
32 | + * |
|
33 | + * @link https://developer.github.com/v3/users/keys/#list-your-public-keys |
|
34 | + * @return array |
|
35 | + * @throws \Exception |
|
36 | + */ |
|
37 | + public function listYourPublicKeys(): array |
|
38 | + { |
|
39 | + return $this->getApi()->request($this->getApi()->sprintf('/user/keys')); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Get a single public key |
|
44 | - * |
|
45 | - * @link https://developer.github.com/v3/users/keys/#get-a-single-public-key |
|
46 | - * |
|
47 | - * @param int $id |
|
48 | - * |
|
49 | - * @return array |
|
50 | - * @throws \Exception |
|
51 | - */ |
|
52 | - public function getSinglePublicKey(int $id): array |
|
53 | - { |
|
54 | - return $this->getApi()->request($this->getApi()->sprintf('/user/keys/:id', (string)$id)); |
|
55 | - } |
|
42 | + /** |
|
43 | + * Get a single public key |
|
44 | + * |
|
45 | + * @link https://developer.github.com/v3/users/keys/#get-a-single-public-key |
|
46 | + * |
|
47 | + * @param int $id |
|
48 | + * |
|
49 | + * @return array |
|
50 | + * @throws \Exception |
|
51 | + */ |
|
52 | + public function getSinglePublicKey(int $id): array |
|
53 | + { |
|
54 | + return $this->getApi()->request($this->getApi()->sprintf('/user/keys/:id', (string)$id)); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * Create a public key |
|
59 | - * |
|
60 | - * @link https://developer.github.com/v3/users/keys/#create-a-public-key |
|
61 | - * @return array |
|
62 | - * @throws \Exception |
|
63 | - */ |
|
64 | - public function createPublicKey(): array |
|
65 | - { |
|
66 | - return $this->getApi()->request($this->getApi()->sprintf('/user/keys'), Request::METHOD_POST); |
|
67 | - } |
|
57 | + /** |
|
58 | + * Create a public key |
|
59 | + * |
|
60 | + * @link https://developer.github.com/v3/users/keys/#create-a-public-key |
|
61 | + * @return array |
|
62 | + * @throws \Exception |
|
63 | + */ |
|
64 | + public function createPublicKey(): array |
|
65 | + { |
|
66 | + return $this->getApi()->request($this->getApi()->sprintf('/user/keys'), Request::METHOD_POST); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Delete a public key |
|
71 | - * |
|
72 | - * @link https://developer.github.com/v3/users/keys/#delete-a-public-key |
|
73 | - * |
|
74 | - * @param int $id |
|
75 | - * |
|
76 | - * @return array |
|
77 | - * @throws \Exception |
|
78 | - */ |
|
79 | - public function deletePublicKey(int $id): array |
|
80 | - { |
|
81 | - return $this->getApi()->request( |
|
82 | - $this->getApi()->sprintf('/user/keys/:id', (string)$id), |
|
83 | - Request::METHOD_DELETE |
|
84 | - ); |
|
85 | - } |
|
69 | + /** |
|
70 | + * Delete a public key |
|
71 | + * |
|
72 | + * @link https://developer.github.com/v3/users/keys/#delete-a-public-key |
|
73 | + * |
|
74 | + * @param int $id |
|
75 | + * |
|
76 | + * @return array |
|
77 | + * @throws \Exception |
|
78 | + */ |
|
79 | + public function deletePublicKey(int $id): array |
|
80 | + { |
|
81 | + return $this->getApi()->request( |
|
82 | + $this->getApi()->sprintf('/user/keys/:id', (string)$id), |
|
83 | + Request::METHOD_DELETE |
|
84 | + ); |
|
85 | + } |
|
86 | 86 | } |
@@ -12,44 +12,44 @@ |
||
12 | 12 | */ |
13 | 13 | abstract class AbstractUsers |
14 | 14 | { |
15 | - /** Api trait */ |
|
16 | - use Api; |
|
15 | + /** Api trait */ |
|
16 | + use Api; |
|
17 | 17 | |
18 | - /** Properties */ |
|
19 | - protected $users; |
|
18 | + /** Properties */ |
|
19 | + protected $users; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructor |
|
23 | - * |
|
24 | - * @param Users $users |
|
25 | - */ |
|
26 | - public function __construct(Users $users) |
|
27 | - { |
|
28 | - $this->setUsers($users); |
|
29 | - $this->setApi($users->getApi()); |
|
30 | - } |
|
21 | + /** |
|
22 | + * Constructor |
|
23 | + * |
|
24 | + * @param Users $users |
|
25 | + */ |
|
26 | + public function __construct(Users $users) |
|
27 | + { |
|
28 | + $this->setUsers($users); |
|
29 | + $this->setApi($users->getApi()); |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Get users |
|
34 | - * |
|
35 | - * @return Users |
|
36 | - */ |
|
37 | - public function getUsers(): Users |
|
38 | - { |
|
39 | - return $this->users; |
|
40 | - } |
|
32 | + /** |
|
33 | + * Get users |
|
34 | + * |
|
35 | + * @return Users |
|
36 | + */ |
|
37 | + public function getUsers(): Users |
|
38 | + { |
|
39 | + return $this->users; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Set users |
|
44 | - * |
|
45 | - * @param Users $users |
|
46 | - * |
|
47 | - * @return AbstractUsers |
|
48 | - */ |
|
49 | - public function setUsers(Users $users): AbstractUsers |
|
50 | - { |
|
51 | - $this->users = $users; |
|
42 | + /** |
|
43 | + * Set users |
|
44 | + * |
|
45 | + * @param Users $users |
|
46 | + * |
|
47 | + * @return AbstractUsers |
|
48 | + */ |
|
49 | + public function setUsers(Users $users): AbstractUsers |
|
50 | + { |
|
51 | + $this->users = $users; |
|
52 | 52 | |
53 | - return $this; |
|
54 | - } |
|
53 | + return $this; |
|
54 | + } |
|
55 | 55 | } |
@@ -12,99 +12,99 @@ |
||
12 | 12 | class Comments extends AbstractGists |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * List comments on a gist |
|
17 | - * |
|
18 | - * @link https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist |
|
19 | - * |
|
20 | - * @param string $gistId |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function listComments(string $gistId): array |
|
25 | - { |
|
26 | - return $this->getApi()->request($this->getApi()->sprintf('/gists/:gist_id/comments', $gistId)); |
|
27 | - } |
|
15 | + /** |
|
16 | + * List comments on a gist |
|
17 | + * |
|
18 | + * @link https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist |
|
19 | + * |
|
20 | + * @param string $gistId |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function listComments(string $gistId): array |
|
25 | + { |
|
26 | + return $this->getApi()->request($this->getApi()->sprintf('/gists/:gist_id/comments', $gistId)); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Get a single comment |
|
31 | - * |
|
32 | - * @link https://developer.github.com/v3/gists/comments/#get-a-single-comment |
|
33 | - * |
|
34 | - * @param string $gistId |
|
35 | - * @param int $id |
|
36 | - * |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - public function getSingleComment(string $gistId, int $id): array |
|
40 | - { |
|
41 | - return $this->getApi()->request($this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id)); |
|
42 | - } |
|
29 | + /** |
|
30 | + * Get a single comment |
|
31 | + * |
|
32 | + * @link https://developer.github.com/v3/gists/comments/#get-a-single-comment |
|
33 | + * |
|
34 | + * @param string $gistId |
|
35 | + * @param int $id |
|
36 | + * |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + public function getSingleComment(string $gistId, int $id): array |
|
40 | + { |
|
41 | + return $this->getApi()->request($this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id)); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * Create a comment |
|
46 | - * |
|
47 | - * @link https://developer.github.com/v3/gists/comments/#create-a-comment |
|
48 | - * |
|
49 | - * @param string $gistId |
|
50 | - * @param string $body |
|
51 | - * |
|
52 | - * @return array |
|
53 | - */ |
|
54 | - public function createComment(string $gistId, string $body): array |
|
55 | - { |
|
56 | - return $this->getApi()->request( |
|
57 | - $this->getApi()->sprintf('/gists/:gist_id/comments', $gistId), |
|
58 | - Request::METHOD_POST, |
|
59 | - [ |
|
60 | - 'body' => $body |
|
61 | - ] |
|
62 | - ); |
|
63 | - } |
|
44 | + /** |
|
45 | + * Create a comment |
|
46 | + * |
|
47 | + * @link https://developer.github.com/v3/gists/comments/#create-a-comment |
|
48 | + * |
|
49 | + * @param string $gistId |
|
50 | + * @param string $body |
|
51 | + * |
|
52 | + * @return array |
|
53 | + */ |
|
54 | + public function createComment(string $gistId, string $body): array |
|
55 | + { |
|
56 | + return $this->getApi()->request( |
|
57 | + $this->getApi()->sprintf('/gists/:gist_id/comments', $gistId), |
|
58 | + Request::METHOD_POST, |
|
59 | + [ |
|
60 | + 'body' => $body |
|
61 | + ] |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * Edit a comment |
|
67 | - * |
|
68 | - * @link https://developer.github.com/v3/gists/comments/#edit-a-comment |
|
69 | - * |
|
70 | - * @param string $gistId |
|
71 | - * @param int $id |
|
72 | - * @param string $body |
|
73 | - * |
|
74 | - * @return array |
|
75 | - */ |
|
76 | - public function editComment(string $gistId, int $id, string $body): array |
|
77 | - { |
|
78 | - return $this->getApi()->request( |
|
79 | - $this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id), |
|
80 | - Request::METHOD_PATCH, |
|
81 | - [ |
|
82 | - 'body' => $body |
|
83 | - ] |
|
84 | - ); |
|
85 | - } |
|
65 | + /** |
|
66 | + * Edit a comment |
|
67 | + * |
|
68 | + * @link https://developer.github.com/v3/gists/comments/#edit-a-comment |
|
69 | + * |
|
70 | + * @param string $gistId |
|
71 | + * @param int $id |
|
72 | + * @param string $body |
|
73 | + * |
|
74 | + * @return array |
|
75 | + */ |
|
76 | + public function editComment(string $gistId, int $id, string $body): array |
|
77 | + { |
|
78 | + return $this->getApi()->request( |
|
79 | + $this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id), |
|
80 | + Request::METHOD_PATCH, |
|
81 | + [ |
|
82 | + 'body' => $body |
|
83 | + ] |
|
84 | + ); |
|
85 | + } |
|
86 | 86 | |
87 | - /** |
|
88 | - * Delete a comment |
|
89 | - * |
|
90 | - * @link https://developer.github.com/v3/gists/comments/#delete-a-comment |
|
91 | - * |
|
92 | - * @param string $gistId |
|
93 | - * @param int $id |
|
94 | - * |
|
95 | - * @return bool |
|
96 | - */ |
|
97 | - public function deleteComment(string $gistId, int $id): bool |
|
98 | - { |
|
99 | - $this->getApi()->request( |
|
100 | - $this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id), |
|
101 | - Request::METHOD_DELETE |
|
102 | - ); |
|
87 | + /** |
|
88 | + * Delete a comment |
|
89 | + * |
|
90 | + * @link https://developer.github.com/v3/gists/comments/#delete-a-comment |
|
91 | + * |
|
92 | + * @param string $gistId |
|
93 | + * @param int $id |
|
94 | + * |
|
95 | + * @return bool |
|
96 | + */ |
|
97 | + public function deleteComment(string $gistId, int $id): bool |
|
98 | + { |
|
99 | + $this->getApi()->request( |
|
100 | + $this->getApi()->sprintf('/gists/:gist_id/comments/:id', $gistId, (string)$id), |
|
101 | + Request::METHOD_DELETE |
|
102 | + ); |
|
103 | 103 | |
104 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
105 | - return true; |
|
106 | - } |
|
104 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
105 | + return true; |
|
106 | + } |
|
107 | 107 | |
108 | - return false; |
|
109 | - } |
|
108 | + return false; |
|
109 | + } |
|
110 | 110 | } |
@@ -12,44 +12,44 @@ |
||
12 | 12 | */ |
13 | 13 | abstract class AbstractGists |
14 | 14 | { |
15 | - /** Api trait */ |
|
16 | - use Api; |
|
15 | + /** Api trait */ |
|
16 | + use Api; |
|
17 | 17 | |
18 | - /** Properties */ |
|
19 | - protected $gists; |
|
18 | + /** Properties */ |
|
19 | + protected $gists; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructor |
|
23 | - * |
|
24 | - * @param Gists $gists |
|
25 | - */ |
|
26 | - public function __construct(Gists $gists) |
|
27 | - { |
|
28 | - $this->setGists($gists); |
|
29 | - $this->setApi($gists->getApi()); |
|
30 | - } |
|
21 | + /** |
|
22 | + * Constructor |
|
23 | + * |
|
24 | + * @param Gists $gists |
|
25 | + */ |
|
26 | + public function __construct(Gists $gists) |
|
27 | + { |
|
28 | + $this->setGists($gists); |
|
29 | + $this->setApi($gists->getApi()); |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Get gists |
|
34 | - * |
|
35 | - * @return Gists |
|
36 | - */ |
|
37 | - public function getGists(): Gists |
|
38 | - { |
|
39 | - return $this->gists; |
|
40 | - } |
|
32 | + /** |
|
33 | + * Get gists |
|
34 | + * |
|
35 | + * @return Gists |
|
36 | + */ |
|
37 | + public function getGists(): Gists |
|
38 | + { |
|
39 | + return $this->gists; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Set gists |
|
44 | - * |
|
45 | - * @param Gists $gists |
|
46 | - * |
|
47 | - * @return AbstractGists |
|
48 | - */ |
|
49 | - public function setGists(Gists $gists): AbstractGists |
|
50 | - { |
|
51 | - $this->gists = $gists; |
|
42 | + /** |
|
43 | + * Set gists |
|
44 | + * |
|
45 | + * @param Gists $gists |
|
46 | + * |
|
47 | + * @return AbstractGists |
|
48 | + */ |
|
49 | + public function setGists(Gists $gists): AbstractGists |
|
50 | + { |
|
51 | + $this->gists = $gists; |
|
52 | 52 | |
53 | - return $this; |
|
54 | - } |
|
53 | + return $this; |
|
54 | + } |
|
55 | 55 | } |
@@ -10,14 +10,14 @@ |
||
10 | 10 | class Feeds extends AbstractActivity |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * List Feeds |
|
15 | - * |
|
16 | - * @link https://developer.github.com/v3/activity/feeds/#list-feeds |
|
17 | - * @return array |
|
18 | - */ |
|
19 | - public function listFeeds(): array |
|
20 | - { |
|
21 | - return $this->getApi()->request(sprintf('/feeds')); |
|
22 | - } |
|
13 | + /** |
|
14 | + * List Feeds |
|
15 | + * |
|
16 | + * @link https://developer.github.com/v3/activity/feeds/#list-feeds |
|
17 | + * @return array |
|
18 | + */ |
|
19 | + public function listFeeds(): array |
|
20 | + { |
|
21 | + return $this->getApi()->request(sprintf('/feeds')); |
|
22 | + } |
|
23 | 23 | } |
@@ -11,146 +11,146 @@ |
||
11 | 11 | class Events extends AbstractActivity |
12 | 12 | { |
13 | 13 | |
14 | - /** |
|
15 | - * List public events |
|
16 | - * |
|
17 | - * @link https://developer.github.com/v3/activity/events/#list-public-events |
|
18 | - * @return array |
|
19 | - */ |
|
20 | - public function listPublicEvents(): array |
|
21 | - { |
|
22 | - return $this->getApi()->request('/events'); |
|
23 | - } |
|
14 | + /** |
|
15 | + * List public events |
|
16 | + * |
|
17 | + * @link https://developer.github.com/v3/activity/events/#list-public-events |
|
18 | + * @return array |
|
19 | + */ |
|
20 | + public function listPublicEvents(): array |
|
21 | + { |
|
22 | + return $this->getApi()->request('/events'); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * List repository events |
|
27 | - * |
|
28 | - * @link https://developer.github.com/v3/activity/events/#list-repository-events |
|
29 | - * @return array |
|
30 | - */ |
|
31 | - public function listRepositoryEvents(): array |
|
32 | - { |
|
33 | - return $this->getApi()->request($this->getApi() |
|
34 | - ->sprintf( |
|
35 | - '/repos/:owner/:repo/events', |
|
36 | - $this->getActivity()->getOwner(), |
|
37 | - $this->getActivity()->getRepo() |
|
38 | - )); |
|
39 | - } |
|
25 | + /** |
|
26 | + * List repository events |
|
27 | + * |
|
28 | + * @link https://developer.github.com/v3/activity/events/#list-repository-events |
|
29 | + * @return array |
|
30 | + */ |
|
31 | + public function listRepositoryEvents(): array |
|
32 | + { |
|
33 | + return $this->getApi()->request($this->getApi() |
|
34 | + ->sprintf( |
|
35 | + '/repos/:owner/:repo/events', |
|
36 | + $this->getActivity()->getOwner(), |
|
37 | + $this->getActivity()->getRepo() |
|
38 | + )); |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * List issue events for a repository |
|
43 | - * |
|
44 | - * @link https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository |
|
45 | - * @return array |
|
46 | - */ |
|
47 | - public function listIssueEvents(): array |
|
48 | - { |
|
49 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
50 | - '/repos/:owner/:repo/issues/events', |
|
51 | - $this->getActivity()->getOwner(), |
|
52 | - $this->getActivity()->getRepo() |
|
53 | - )); |
|
54 | - } |
|
41 | + /** |
|
42 | + * List issue events for a repository |
|
43 | + * |
|
44 | + * @link https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository |
|
45 | + * @return array |
|
46 | + */ |
|
47 | + public function listIssueEvents(): array |
|
48 | + { |
|
49 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
50 | + '/repos/:owner/:repo/issues/events', |
|
51 | + $this->getActivity()->getOwner(), |
|
52 | + $this->getActivity()->getRepo() |
|
53 | + )); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * List public events for a network of repositories |
|
58 | - * |
|
59 | - * @link https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories |
|
60 | - * @return array |
|
61 | - */ |
|
62 | - public function listPublicNetworkEvents(): array |
|
63 | - { |
|
64 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
65 | - '/networks/:owner/:repo/events', |
|
66 | - $this->getActivity()->getOwner(), |
|
67 | - $this->getActivity()->getRepo() |
|
68 | - )); |
|
69 | - } |
|
56 | + /** |
|
57 | + * List public events for a network of repositories |
|
58 | + * |
|
59 | + * @link https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories |
|
60 | + * @return array |
|
61 | + */ |
|
62 | + public function listPublicNetworkEvents(): array |
|
63 | + { |
|
64 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
65 | + '/networks/:owner/:repo/events', |
|
66 | + $this->getActivity()->getOwner(), |
|
67 | + $this->getActivity()->getRepo() |
|
68 | + )); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * List public events for an organization |
|
73 | - * |
|
74 | - * @link https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization |
|
75 | - * |
|
76 | - * @param string $organization |
|
77 | - * |
|
78 | - * @return array |
|
79 | - */ |
|
80 | - public function listPublicOrganizationEvents(string $organization): array |
|
81 | - { |
|
82 | - return $this->getApi()->request($this->getApi()->sprintf('/orgs/:org/events', $organization)); |
|
83 | - } |
|
71 | + /** |
|
72 | + * List public events for an organization |
|
73 | + * |
|
74 | + * @link https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization |
|
75 | + * |
|
76 | + * @param string $organization |
|
77 | + * |
|
78 | + * @return array |
|
79 | + */ |
|
80 | + public function listPublicOrganizationEvents(string $organization): array |
|
81 | + { |
|
82 | + return $this->getApi()->request($this->getApi()->sprintf('/orgs/:org/events', $organization)); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * List events that a user has received |
|
87 | - * |
|
88 | - * @link https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received |
|
89 | - * |
|
90 | - * @param string $username |
|
91 | - * |
|
92 | - * @return array |
|
93 | - */ |
|
94 | - public function listUserReceiveEvents(string $username): array |
|
95 | - { |
|
96 | - return $this->getApi()->request($this->getApi()->sprintf('/users/:username/received_events', $username)); |
|
97 | - } |
|
85 | + /** |
|
86 | + * List events that a user has received |
|
87 | + * |
|
88 | + * @link https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received |
|
89 | + * |
|
90 | + * @param string $username |
|
91 | + * |
|
92 | + * @return array |
|
93 | + */ |
|
94 | + public function listUserReceiveEvents(string $username): array |
|
95 | + { |
|
96 | + return $this->getApi()->request($this->getApi()->sprintf('/users/:username/received_events', $username)); |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * List public events that a user has received |
|
101 | - * |
|
102 | - * @link https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received |
|
103 | - * |
|
104 | - * @param string $username |
|
105 | - * |
|
106 | - * @return array |
|
107 | - */ |
|
108 | - public function listPublicUserReceiveEvents(string $username): array |
|
109 | - { |
|
110 | - return $this->getApi()->request($this->getApi()->sprintf('/users/:username/received_events/public', $username)); |
|
111 | - } |
|
99 | + /** |
|
100 | + * List public events that a user has received |
|
101 | + * |
|
102 | + * @link https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received |
|
103 | + * |
|
104 | + * @param string $username |
|
105 | + * |
|
106 | + * @return array |
|
107 | + */ |
|
108 | + public function listPublicUserReceiveEvents(string $username): array |
|
109 | + { |
|
110 | + return $this->getApi()->request($this->getApi()->sprintf('/users/:username/received_events/public', $username)); |
|
111 | + } |
|
112 | 112 | |
113 | - /** |
|
114 | - * List events performed by a user |
|
115 | - * |
|
116 | - * @link https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user |
|
117 | - * |
|
118 | - * @param string $username |
|
119 | - * |
|
120 | - * @return array |
|
121 | - */ |
|
122 | - public function listUserPerformedEvents(string $username): array |
|
123 | - { |
|
124 | - return $this->getApi()->request($this->getApi()->sprintf('/users/:username/events', $username)); |
|
125 | - } |
|
113 | + /** |
|
114 | + * List events performed by a user |
|
115 | + * |
|
116 | + * @link https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user |
|
117 | + * |
|
118 | + * @param string $username |
|
119 | + * |
|
120 | + * @return array |
|
121 | + */ |
|
122 | + public function listUserPerformedEvents(string $username): array |
|
123 | + { |
|
124 | + return $this->getApi()->request($this->getApi()->sprintf('/users/:username/events', $username)); |
|
125 | + } |
|
126 | 126 | |
127 | - /** |
|
128 | - * List public events performed by a user |
|
129 | - * |
|
130 | - * @link https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user |
|
131 | - * |
|
132 | - * @param string $username |
|
133 | - * |
|
134 | - * @return array |
|
135 | - */ |
|
136 | - public function listPublicUserPerformedEvents(string $username): array |
|
137 | - { |
|
138 | - return $this->getApi()->request($this->getApi()->sprintf('/users/:username/events/public', $username)); |
|
139 | - } |
|
127 | + /** |
|
128 | + * List public events performed by a user |
|
129 | + * |
|
130 | + * @link https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user |
|
131 | + * |
|
132 | + * @param string $username |
|
133 | + * |
|
134 | + * @return array |
|
135 | + */ |
|
136 | + public function listPublicUserPerformedEvents(string $username): array |
|
137 | + { |
|
138 | + return $this->getApi()->request($this->getApi()->sprintf('/users/:username/events/public', $username)); |
|
139 | + } |
|
140 | 140 | |
141 | - /** |
|
142 | - * List events for an organization |
|
143 | - * |
|
144 | - * @link https://developer.github.com/v3/activity/events/#list-events-for-an-organization |
|
145 | - * |
|
146 | - * @param string $username |
|
147 | - * @param string $organization |
|
148 | - * |
|
149 | - * @return array |
|
150 | - */ |
|
151 | - public function listOrganizationEvents(string $username, string $organization): array |
|
152 | - { |
|
153 | - return $this->getApi()->request($this->getApi() |
|
154 | - ->sprintf('/users/:username/events/orgs/:org', $username, $organization)); |
|
155 | - } |
|
141 | + /** |
|
142 | + * List events for an organization |
|
143 | + * |
|
144 | + * @link https://developer.github.com/v3/activity/events/#list-events-for-an-organization |
|
145 | + * |
|
146 | + * @param string $username |
|
147 | + * @param string $organization |
|
148 | + * |
|
149 | + * @return array |
|
150 | + */ |
|
151 | + public function listOrganizationEvents(string $username, string $organization): array |
|
152 | + { |
|
153 | + return $this->getApi()->request($this->getApi() |
|
154 | + ->sprintf('/users/:username/events/orgs/:org', $username, $organization)); |
|
155 | + } |
|
156 | 156 | } |
@@ -13,172 +13,172 @@ |
||
13 | 13 | class Watching extends AbstractActivity |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * List watchers |
|
18 | - * |
|
19 | - * @link https://developer.github.com/v3/activity/watching/#list-watchers |
|
20 | - * @return array |
|
21 | - */ |
|
22 | - public function listWatchers(): array |
|
23 | - { |
|
24 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
25 | - '/repos/:owner/:repo/subscribers', |
|
26 | - $this->getActivity()->getOwner(), |
|
27 | - $this->getActivity()->getRepo() |
|
28 | - )); |
|
29 | - } |
|
30 | - |
|
31 | - /** |
|
32 | - * List repositories being watched |
|
33 | - * |
|
34 | - * @link https://developer.github.com/v3/activity/watching/#list-repositories-being-watched |
|
35 | - * |
|
36 | - * @param string $username |
|
37 | - * |
|
38 | - * @return array |
|
39 | - */ |
|
40 | - public function listSubscriptions(string $username = null): array |
|
41 | - { |
|
42 | - if (null !== $username) { |
|
43 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
44 | - '/users/:username/subscriptions', |
|
45 | - $this->getActivity()->getOwner(), |
|
46 | - $this->getActivity()->getRepo(), |
|
47 | - $username |
|
48 | - )); |
|
49 | - } |
|
50 | - |
|
51 | - return $this->getApi()->request($this->getApi() |
|
52 | - ->sprintf( |
|
53 | - '/user/subscriptions', |
|
54 | - $this->getActivity()->getOwner(), |
|
55 | - $this->getActivity()->getRepo() |
|
56 | - )); |
|
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * Get a Repository Subscription |
|
61 | - * |
|
62 | - * @link https://developer.github.com/v3/activity/watching/#get-a-repository-subscription |
|
63 | - * @return array |
|
64 | - */ |
|
65 | - public function getRepositorySubscription(): array |
|
66 | - { |
|
67 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
68 | - '/repos/:owner/:repo/subscription', |
|
69 | - $this->getActivity()->getOwner(), |
|
70 | - $this->getActivity()->getRepo() |
|
71 | - )); |
|
72 | - } |
|
73 | - |
|
74 | - /** |
|
75 | - * Set a Repository Subscription |
|
76 | - * |
|
77 | - * @link https://developer.github.com/v3/activity/watching/#set-a-repository-subscription |
|
78 | - * |
|
79 | - * @param bool $subscribed |
|
80 | - * @param bool $ignored |
|
81 | - * |
|
82 | - * @return array |
|
83 | - */ |
|
84 | - public function setRepositorySubscription(bool $subscribed = false, bool $ignored = false): array |
|
85 | - { |
|
86 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
87 | - '/repos/:owner/:repo/subscription?:args', |
|
88 | - $this->getActivity()->getOwner(), |
|
89 | - $this->getActivity()->getRepo(), |
|
90 | - http_build_query([ |
|
91 | - 'subscribed' => $subscribed, |
|
92 | - 'ignored' => $ignored |
|
93 | - ]) |
|
94 | - ), Request::METHOD_PUT); |
|
95 | - } |
|
96 | - |
|
97 | - /** |
|
98 | - * Delete a Repository Subscription |
|
99 | - * |
|
100 | - * @link https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription |
|
101 | - * @return bool |
|
102 | - */ |
|
103 | - public function deleteRepositorySubscription(): bool |
|
104 | - { |
|
105 | - $this->getApi()->request($this->getApi() |
|
106 | - ->sprintf( |
|
107 | - '/repos/:owner/:repo/subscription', |
|
108 | - $this->getActivity()->getOwner(), |
|
109 | - $this->getActivity()->getRepo() |
|
110 | - ), Request::METHOD_DELETE); |
|
111 | - |
|
112 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
113 | - return true; |
|
114 | - } |
|
115 | - |
|
116 | - return false; |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * Check if you are watching a repository (LEGACY) |
|
121 | - * |
|
122 | - * @link https://developer.github.com/v3/activity/watching/#check-if-you-are-watching-a-repository-legacy |
|
123 | - * @return bool |
|
124 | - */ |
|
125 | - public function userSubscriptions(): bool |
|
126 | - { |
|
127 | - $this->getApi()->request($this->getApi() |
|
128 | - ->sprintf( |
|
129 | - '/user/subscriptions/:owner/:repo', |
|
130 | - $this->getActivity()->getOwner(), |
|
131 | - $this->getActivity()->getRepo() |
|
132 | - )); |
|
133 | - |
|
134 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
135 | - return true; |
|
136 | - } |
|
137 | - |
|
138 | - return false; |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Watch a repository (LEGACY) |
|
143 | - * |
|
144 | - * @link https://developer.github.com/v3/activity/watching/#watch-a-repository-legacy |
|
145 | - * @return bool |
|
146 | - */ |
|
147 | - public function watchRepository(): bool |
|
148 | - { |
|
149 | - $this->getApi()->request($this->getApi() |
|
150 | - ->sprintf( |
|
151 | - '/user/subscriptions/:owner/:repo', |
|
152 | - $this->getActivity()->getOwner(), |
|
153 | - $this->getActivity()->getRepo() |
|
154 | - ), Request::METHOD_PUT); |
|
155 | - |
|
156 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
157 | - return true; |
|
158 | - } |
|
159 | - |
|
160 | - return false; |
|
161 | - } |
|
162 | - |
|
163 | - /** |
|
164 | - * Stop watching a repository (LEGACY) |
|
165 | - * |
|
166 | - * @link https://developer.github.com/v3/activity/watching/#stop-watching-a-repository-legacy |
|
167 | - * @return bool |
|
168 | - */ |
|
169 | - public function stopWatchingRepository(): bool |
|
170 | - { |
|
171 | - $this->getApi()->request($this->getApi() |
|
172 | - ->sprintf( |
|
173 | - '/user/subscriptions/:owner/:repo', |
|
174 | - $this->getActivity()->getOwner(), |
|
175 | - $this->getActivity()->getRepo() |
|
176 | - ), Request::METHOD_DELETE); |
|
177 | - |
|
178 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
179 | - return true; |
|
180 | - } |
|
181 | - |
|
182 | - return false; |
|
183 | - } |
|
16 | + /** |
|
17 | + * List watchers |
|
18 | + * |
|
19 | + * @link https://developer.github.com/v3/activity/watching/#list-watchers |
|
20 | + * @return array |
|
21 | + */ |
|
22 | + public function listWatchers(): array |
|
23 | + { |
|
24 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
25 | + '/repos/:owner/:repo/subscribers', |
|
26 | + $this->getActivity()->getOwner(), |
|
27 | + $this->getActivity()->getRepo() |
|
28 | + )); |
|
29 | + } |
|
30 | + |
|
31 | + /** |
|
32 | + * List repositories being watched |
|
33 | + * |
|
34 | + * @link https://developer.github.com/v3/activity/watching/#list-repositories-being-watched |
|
35 | + * |
|
36 | + * @param string $username |
|
37 | + * |
|
38 | + * @return array |
|
39 | + */ |
|
40 | + public function listSubscriptions(string $username = null): array |
|
41 | + { |
|
42 | + if (null !== $username) { |
|
43 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
44 | + '/users/:username/subscriptions', |
|
45 | + $this->getActivity()->getOwner(), |
|
46 | + $this->getActivity()->getRepo(), |
|
47 | + $username |
|
48 | + )); |
|
49 | + } |
|
50 | + |
|
51 | + return $this->getApi()->request($this->getApi() |
|
52 | + ->sprintf( |
|
53 | + '/user/subscriptions', |
|
54 | + $this->getActivity()->getOwner(), |
|
55 | + $this->getActivity()->getRepo() |
|
56 | + )); |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * Get a Repository Subscription |
|
61 | + * |
|
62 | + * @link https://developer.github.com/v3/activity/watching/#get-a-repository-subscription |
|
63 | + * @return array |
|
64 | + */ |
|
65 | + public function getRepositorySubscription(): array |
|
66 | + { |
|
67 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
68 | + '/repos/:owner/:repo/subscription', |
|
69 | + $this->getActivity()->getOwner(), |
|
70 | + $this->getActivity()->getRepo() |
|
71 | + )); |
|
72 | + } |
|
73 | + |
|
74 | + /** |
|
75 | + * Set a Repository Subscription |
|
76 | + * |
|
77 | + * @link https://developer.github.com/v3/activity/watching/#set-a-repository-subscription |
|
78 | + * |
|
79 | + * @param bool $subscribed |
|
80 | + * @param bool $ignored |
|
81 | + * |
|
82 | + * @return array |
|
83 | + */ |
|
84 | + public function setRepositorySubscription(bool $subscribed = false, bool $ignored = false): array |
|
85 | + { |
|
86 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
87 | + '/repos/:owner/:repo/subscription?:args', |
|
88 | + $this->getActivity()->getOwner(), |
|
89 | + $this->getActivity()->getRepo(), |
|
90 | + http_build_query([ |
|
91 | + 'subscribed' => $subscribed, |
|
92 | + 'ignored' => $ignored |
|
93 | + ]) |
|
94 | + ), Request::METHOD_PUT); |
|
95 | + } |
|
96 | + |
|
97 | + /** |
|
98 | + * Delete a Repository Subscription |
|
99 | + * |
|
100 | + * @link https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription |
|
101 | + * @return bool |
|
102 | + */ |
|
103 | + public function deleteRepositorySubscription(): bool |
|
104 | + { |
|
105 | + $this->getApi()->request($this->getApi() |
|
106 | + ->sprintf( |
|
107 | + '/repos/:owner/:repo/subscription', |
|
108 | + $this->getActivity()->getOwner(), |
|
109 | + $this->getActivity()->getRepo() |
|
110 | + ), Request::METHOD_DELETE); |
|
111 | + |
|
112 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
113 | + return true; |
|
114 | + } |
|
115 | + |
|
116 | + return false; |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * Check if you are watching a repository (LEGACY) |
|
121 | + * |
|
122 | + * @link https://developer.github.com/v3/activity/watching/#check-if-you-are-watching-a-repository-legacy |
|
123 | + * @return bool |
|
124 | + */ |
|
125 | + public function userSubscriptions(): bool |
|
126 | + { |
|
127 | + $this->getApi()->request($this->getApi() |
|
128 | + ->sprintf( |
|
129 | + '/user/subscriptions/:owner/:repo', |
|
130 | + $this->getActivity()->getOwner(), |
|
131 | + $this->getActivity()->getRepo() |
|
132 | + )); |
|
133 | + |
|
134 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
135 | + return true; |
|
136 | + } |
|
137 | + |
|
138 | + return false; |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Watch a repository (LEGACY) |
|
143 | + * |
|
144 | + * @link https://developer.github.com/v3/activity/watching/#watch-a-repository-legacy |
|
145 | + * @return bool |
|
146 | + */ |
|
147 | + public function watchRepository(): bool |
|
148 | + { |
|
149 | + $this->getApi()->request($this->getApi() |
|
150 | + ->sprintf( |
|
151 | + '/user/subscriptions/:owner/:repo', |
|
152 | + $this->getActivity()->getOwner(), |
|
153 | + $this->getActivity()->getRepo() |
|
154 | + ), Request::METHOD_PUT); |
|
155 | + |
|
156 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
157 | + return true; |
|
158 | + } |
|
159 | + |
|
160 | + return false; |
|
161 | + } |
|
162 | + |
|
163 | + /** |
|
164 | + * Stop watching a repository (LEGACY) |
|
165 | + * |
|
166 | + * @link https://developer.github.com/v3/activity/watching/#stop-watching-a-repository-legacy |
|
167 | + * @return bool |
|
168 | + */ |
|
169 | + public function stopWatchingRepository(): bool |
|
170 | + { |
|
171 | + $this->getApi()->request($this->getApi() |
|
172 | + ->sprintf( |
|
173 | + '/user/subscriptions/:owner/:repo', |
|
174 | + $this->getActivity()->getOwner(), |
|
175 | + $this->getActivity()->getRepo() |
|
176 | + ), Request::METHOD_DELETE); |
|
177 | + |
|
178 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
179 | + return true; |
|
180 | + } |
|
181 | + |
|
182 | + return false; |
|
183 | + } |
|
184 | 184 | } |
@@ -12,44 +12,44 @@ |
||
12 | 12 | */ |
13 | 13 | abstract class AbstractActivity |
14 | 14 | { |
15 | - /** Api trait */ |
|
16 | - use Api; |
|
15 | + /** Api trait */ |
|
16 | + use Api; |
|
17 | 17 | |
18 | - /** Properties */ |
|
19 | - protected $activity; |
|
18 | + /** Properties */ |
|
19 | + protected $activity; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructor |
|
23 | - * |
|
24 | - * @param Activity $activity |
|
25 | - */ |
|
26 | - public function __construct(Activity $activity) |
|
27 | - { |
|
28 | - $this->setActivity($activity); |
|
29 | - $this->setApi($activity->getApi()); |
|
30 | - } |
|
21 | + /** |
|
22 | + * Constructor |
|
23 | + * |
|
24 | + * @param Activity $activity |
|
25 | + */ |
|
26 | + public function __construct(Activity $activity) |
|
27 | + { |
|
28 | + $this->setActivity($activity); |
|
29 | + $this->setApi($activity->getApi()); |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Get activity |
|
34 | - * |
|
35 | - * @return Activity |
|
36 | - */ |
|
37 | - public function getActivity(): Activity |
|
38 | - { |
|
39 | - return $this->activity; |
|
40 | - } |
|
32 | + /** |
|
33 | + * Get activity |
|
34 | + * |
|
35 | + * @return Activity |
|
36 | + */ |
|
37 | + public function getActivity(): Activity |
|
38 | + { |
|
39 | + return $this->activity; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Set activity |
|
44 | - * |
|
45 | - * @param Activity $activity |
|
46 | - * |
|
47 | - * @return AbstractActivity |
|
48 | - */ |
|
49 | - public function setActivity(Activity $activity): AbstractActivity |
|
50 | - { |
|
51 | - $this->activity = $activity; |
|
42 | + /** |
|
43 | + * Set activity |
|
44 | + * |
|
45 | + * @param Activity $activity |
|
46 | + * |
|
47 | + * @return AbstractActivity |
|
48 | + */ |
|
49 | + public function setActivity(Activity $activity): AbstractActivity |
|
50 | + { |
|
51 | + $this->activity = $activity; |
|
52 | 52 | |
53 | - return $this; |
|
54 | - } |
|
53 | + return $this; |
|
54 | + } |
|
55 | 55 | } |