Skip to content
15 changes: 15 additions & 0 deletions lib/Github/Api/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,19 @@ public function markRead(DateTime $since = null)

$this->put('/notifications', $parameters);
}
/**
* [UNDOCUMENTED] Gets a single notification using his ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "UNDOCUMENTED"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't in this library documentation

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to remove "[UNDOCUMENTED]" and add some documentation instead =)

*
* @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread
*
* @param ID|integer $id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be @param int $id

*/
public function id($id)
{
if (!is_numeric($id)) {
// Error
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do I do here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okey if you remove this if statement. If someone uses a string they will get a 404 back.

}

return $this->get('/notifications/threads/'.$id);
}
}