Repository navigation
Expand file tree
/
Copy pathUser.php
More file actions
151 lines (139 loc) · 4.2 KB
/
Copy pathUser.php
File metadata and controls
151 lines (139 loc) · 4.2 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
namespace Github\Api;
/**
* Searching users, getting user information
*
* @link http://developer.github.com/v3/users/
* @author Joseph Bielawski <stloyd@gmail.com>
* @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
* @deprecated see subscriptions method
*
* @param string $username the username
* @return array list of watched repositories
*/
public function watched($username)
{
return $this->get('users/'.rawurlencode($username).'/watched');
}
/**
* Request starred repositories that a specific user has starred
* @link http://developer.github.com/v3/activity/starring/
*
* @param string $username the username
* @param int $page the page number of the paginated result set
* @return array list of starred repositories
*/
public function starred($username, $page = 1)
{
return $this->get('users/'.rawurlencode($username).'/starred', array(
'page' => $page
));
}
/**
* Request the repository that a specific user is watching
* @link http://developer.github.com/v3/activity/watching/
*
* @param string $username the username
* @return array list of watched repositories
*/
public function subscriptions($username)
{
return $this->get('users/'.rawurlencode($username).'/subscriptions');
}
/**
* 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');
}
}