Skip to content

Add support for retrieving a single notification info using his ID #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 20, 2016
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);
}
}