File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -18,24 +18,13 @@ class Comments extends AbstractApi
18
18
*/
19
19
public function configure ($ bodyType = null )
20
20
{
21
- switch ($ bodyType ) {
22
- case 'raw ' :
23
- $ header = 'Accept: application/vnd.github.%s.raw+json ' ;
24
- break ;
25
-
26
- case 'text ' :
27
- $ header = 'Accept: application/vnd.github.%s.text+json ' ;
28
- break ;
29
-
30
- case 'html ' :
31
- $ header = 'Accept: application/vnd.github.%s.html+json ' ;
32
- break ;
33
-
34
- default :
35
- $ header = 'Accept: application/vnd.github.%s.full+json ' ;
21
+ if (!in_array ($ bodyType , array ('raw ' , 'text ' , 'html ' ))) {
22
+ $ bodyType = 'full ' ;
36
23
}
37
24
38
- $ this ->client ->setHeaders (array (sprintf ($ header , $ this ->client ->getOption ('api_version ' ))));
25
+ $ this ->client ->setHeaders (array (
26
+ sprintf ('Accept: application/vnd.github.%s.%s+json ' , $ this ->client ->getOption ('api_version ' ), $ bodyType )
27
+ ));
39
28
}
40
29
41
30
/**
You can’t perform that action at this time.
0 commit comments