File tree Expand file tree Collapse file tree 6 files changed +92
-0
lines changed Expand file tree Collapse file tree 6 files changed +92
-0
lines changed Original file line number Diff line number Diff line change 17
17
* [ Releases] ( repo/releases.md )
18
18
* [ Assets] ( repo/assets.md )
19
19
* [ Users] ( users.md )
20
+ * [ Meta] ( meta.md )
20
21
21
22
Additional features:
22
23
Original file line number Diff line number Diff line change
1
+ ## Users API
2
+ [ Back to the navigation] ( index.md )
3
+
4
+
5
+ Wrap [ GitHub User API] ( http://developer.github.com/v3/meta/ ) .
6
+
7
+ ### Get information about GitHub services
8
+
9
+ ``` php
10
+ $service = $client->api('meta')->service();
11
+ ```
12
+
13
+ return
14
+
15
+ ```
16
+ array(3) {
17
+ 'verifiable_password_authentication' => bool
18
+ 'hooks' =>
19
+ array(1) {
20
+ [0] =>
21
+ string(15) "127.0.0.1/22"
22
+ }
23
+ 'git' =>
24
+ array(1) {
25
+ [0] =>
26
+ string(15) "127.0.0.1/22"
27
+ }
28
+ }
29
+ ```
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Github \Api ;
4
+
5
+ /**
6
+ * Getting GitHub service information
7
+ *
8
+ * @link https://developer.github.com/v3/meta/
9
+ * @author Claude Dioudonnat <claude.dioudonnat@gmail.com>
10
+ */
11
+ class Meta extends AbstractApi
12
+ {
13
+ /**
14
+ * Get the ip address of the hook and git servers for the GitHub.com service
15
+ *
16
+ * @return array Informations about the service of GitHub.com
17
+ */
18
+ public function service ()
19
+ {
20
+ return $ this ->get ('meta ' );
21
+ }
22
+ }
Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ public function api($name)
139
139
$ api = new Api \Authorizations ($ this );
140
140
break ;
141
141
142
+ case 'meta ' :
143
+ $ api = new Api \Meta ($ this );
144
+ break ;
145
+
142
146
default :
143
147
throw new InvalidArgumentException (sprintf ('Undefined api instance called: "%s" ' , $ name ));
144
148
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Github \Tests \Api ;
4
+
5
+ class MetaTest extends TestCase
6
+ {
7
+ /**
8
+ * @test
9
+ */
10
+ public function shouldGetInformationService ()
11
+ {
12
+ $ expectedArray = array (
13
+ 'hooks ' => array (
14
+ '127.0.0.1/32 '
15
+ ),
16
+ 'git ' => array (
17
+ '127.0.0.1/32 '
18
+ ),
19
+ 'verifiable_password_authentication ' => true
20
+ );
21
+
22
+ $ api = $ this ->getApiMock ();
23
+ $ api ->expects ($ this ->once ())
24
+ ->method ('get ' )
25
+ ->will ($ this ->returnValue ($ expectedArray ));
26
+
27
+ $ this ->assertEquals ($ expectedArray , $ api ->service ());
28
+ }
29
+
30
+ protected function getApiClass ()
31
+ {
32
+ return 'Github\Api\Meta ' ;
33
+ }
34
+ }
Original file line number Diff line number Diff line change @@ -168,6 +168,8 @@ public function getApiClassesProvider()
168
168
169
169
array ('authorization ' , 'Github\Api\Authorizations ' ),
170
170
array ('authorizations ' , 'Github\Api\Authorizations ' ),
171
+
172
+ array ('meta ' , 'Github\Api\Meta ' )
171
173
);
172
174
}
173
175
You can’t perform that action at this time.
0 commit comments