forked from KnpLabs/php-github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
124 lines (114 loc) · 3.36 KB
/
User.php
File metadata and controls
124 lines (114 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
namespace Github\Api;
/**
* Searching users, getting user information
*
* @link http://developer.github.com/v3/users/
* @author Joseph Bielawski <[email protected]>
* @author Thibault Duplessis <thibault.duplessis at gmail dot com>
*/
class User extends AbstractApi
{
/**
* Search users by username:
* @link http://developer.github.com/v3/search/#search-users
*
* @param string $keyword the keyword to search
*
* @return array list of users found
*/
public function find($keyword)
{
return $this->get('legacy/user/search/'.rawurlencode($keyword));
}
/**
* Get extended information about a user by its username
* @link http://developer.github.com/v3/users/
*
* @param string $username the username to show
* @return array informations about the user
*/
public function show($username)
{
return $this->get('users/'.rawurlencode($username));
}
/**
* Request the users that a specific user is following
* @link http://developer.github.com/v3/users/followers/
*
* @param string $username the username
* @return array list of followed users
*/
public function following($username)
{
return $this->get('users/'.rawurlencode($username).'/following');
}
/**
* Request the users following a specific user
* @link http://developer.github.com/v3/users/followers/
*
* @param string $username the username
* @return array list of following users
*/
public function followers($username)
{
return $this->get('users/'.rawurlencode($username).'/followers');
}
/**
* Request the repository that a specific user is watching
* @link http://developer.github.com/v3/repos/watching/
*
* @param string $username the username
* @return array list of watched repositories
*/
public function watched($username)
{
return $this->get('users/'.rawurlencode($username).'/watched');
}
/**
* Get the repositories of a user
* @link http://developer.github.com/v3/repos/
*
* @param string $username the username
* @return array list of the user repositories
*/
public function repositories($username)
{
return $this->get('users/'.rawurlencode($username).'/repos');
}
/**
* Get the public gists for a user
* @link http://developer.github.com/v3/gists/
*
* @param string $username the username
* @return array list of the user gists
*/
public function gists($username)
{
return $this->get('users/'.rawurlencode($username).'/gists');
}
/**
* Get the public keys for a user
* @link http://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
*
* @param string $username the username
* @return array list of the user public keys
*/
public function keys($username)
{
return $this->get('users/'.rawurlencode($username).'/keys');
}
/**
* List events performed by a user
*
* @link http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user
*
* @param string $username
*
* @return array
*/
public function publicEvents($username)
{
return $this->get('users/'.rawurlencode($username) . '/events/public');
}
}