Skip to content

Commit 893908e

Browse files
m1guelpfNyholm
authored andcommitted
Add support for retrieving a single notification info using his ID (#489)
* Add support for retrieving a single notification info using his ID * Syntax * StyleCI * Apply fixes from StyleCI * Fix input type * Fix as said * Apply fixes from StyleCI * Remove undocumented * Add documentation
1 parent a86aa7a commit 893908e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/notification.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ $client->api('notification')->markRead(new DateTime('2015/01/01'));
3636
```
3737

3838
Marks all notifications as read up until the current date, unless a date is given
39+
40+
## Get a single notification using his ID
41+
42+
```php
43+
$client->api('notification')->id($id);
44+
```
45+
Retrieves single notification data using his ID.

lib/Github/Api/Notification.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,15 @@ public function markRead(DateTime $since = null)
5757

5858
$this->put('/notifications', $parameters);
5959
}
60+
/**
61+
* Gets a single notification using his ID
62+
*
63+
* @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread
64+
*
65+
* @param int $id
66+
*/
67+
public function id($id)
68+
{
69+
return $this->get('/notifications/threads/'.$id);
70+
}
6071
}

0 commit comments

Comments
 (0)