Skip to content

Commit aa67239

Browse files
author
Thibaud Fabre
committed
Fix doc comment formatting
1 parent e17cbcb commit aa67239

File tree

1 file changed

+60
-35
lines changed

1 file changed

+60
-35
lines changed

lib/Github/Api/AbstractApi.php

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class AbstractApi implements ApiInterface
2323
/**
2424
* number of items per page (GitHub pagination)
2525
*
26-
* @var null int
26+
* @var null|int
2727
*/
2828
protected $perPage;
2929

@@ -37,11 +37,12 @@ public function __construct(Client $client)
3737
}
3838

3939
public function configure()
40-
{}
40+
{
41+
}
4142

4243
/**
4344
*
44-
* @return null int
45+
* @return null|int
4546
*/
4647
public function getPerPage()
4748
{
@@ -62,14 +63,14 @@ public function setPerPage($perPage)
6263
/**
6364
* Send a GET request with query parameters.
6465
*
65-
* @param string $path Request path.
66-
* @param array $parameters GET parameters.
67-
* @param array $requestHeaders Request Headers.
68-
* @return \Guzzle\Http\EntityBodyInterface mixed string
66+
* @param string $path Request path.
67+
* @param array $parameters GET parameters.
68+
* @param array $requestHeaders Request Headers.
69+
* @return \Guzzle\Http\EntityBodyInterface|mixed|string
6970
*/
7071
protected function get($path, array $parameters = array(), $requestHeaders = array())
7172
{
72-
if (null !== $this->perPage && ! isset($parameters['per_page'])) {
73+
if (null !== $this->perPage && !isset($parameters['per_page'])) {
7374
$parameters['per_page'] = $this->perPage;
7475
}
7576
if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
@@ -83,13 +84,17 @@ protected function get($path, array $parameters = array(), $requestHeaders = arr
8384
/**
8485
* Send a HEAD request with query parameters
8586
*
86-
* @param string $path Request path.
87-
* @param array $parameters HEAD parameters.
88-
* @param array $requestHeaders Request headers.
89-
* @return \Guzzle\Http\Message\Response Response.
87+
* @param string $path Request path.
88+
* @param array $parameters HEAD parameters.
89+
* @param array $requestHeaders Request headers.
90+
* @return \Guzzle\Http\Message\Response
9091
*/
9192
protected function head($path, array $parameters = array(), $requestHeaders = array())
9293
{
94+
if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
95+
unset($parameters['ref']);
96+
}
97+
9398
$response = $this->client->getHttpClient()->request($path, null, 'HEAD', $requestHeaders, array(
9499
'query' => $parameters
95100
));
@@ -100,77 +105,97 @@ protected function head($path, array $parameters = array(), $requestHeaders = ar
100105
/**
101106
* Send a POST request with JSON-encoded parameters.
102107
*
103-
* @param string $path Request path.
104-
* @param array $parameters POST parameters to be JSON encoded.
105-
* @param array $requestHeaders Request headers.
108+
* @param string $path Request path.
109+
* @param array $parameters POST parameters to be JSON encoded.
110+
* @param array $requestHeaders Request headers.
106111
*/
107112
protected function post($path, array $parameters = array(), $requestHeaders = array())
108113
{
109-
return $this->postRaw($path, $this->createJsonBody($parameters), $requestHeaders);
114+
return $this->postRaw(
115+
$path,
116+
$this->createJsonBody($parameters),
117+
$requestHeaders
118+
);
110119
}
111120

112121
/**
113122
* Send a POST request with raw data.
114123
*
115-
* @param string $path Request path.
116-
* @param $body Request body.
117-
* @param array $requestHeaders Request headers.
118-
* @return \Guzzle\Http\EntityBodyInterface mixed string
124+
* @param string $path Request path.
125+
* @param $body Request body.
126+
* @param array $requestHeaders Request headers.
127+
* @return \Guzzle\Http\EntityBodyInterface|mixed|string
119128
*/
120129
protected function postRaw($path, $body, $requestHeaders = array())
121130
{
122-
$response = $this->client->getHttpClient()->post($path, $body, $requestHeaders);
131+
$response = $this->client->getHttpClient()->post(
132+
$path,
133+
$body,
134+
$requestHeaders
135+
);
123136

124137
return ResponseMediator::getContent($response);
125138
}
126139

127140
/**
128141
* Send a PATCH request with JSON-encoded parameters.
129142
*
130-
* @param string $path Request path.
131-
* @param array $parameters POST parameters to be JSON encoded.
132-
* @param array $requestHeaders Request headers.
143+
* @param string $path Request path.
144+
* @param array $parameters POST parameters to be JSON encoded.
145+
* @param array $requestHeaders Request headers.
133146
*/
134147
protected function patch($path, array $parameters = array(), $requestHeaders = array())
135148
{
136-
$response = $this->client->getHttpClient()->patch($path, $this->createJsonBody($parameters), $requestHeaders);
149+
$response = $this->client->getHttpClient()->patch(
150+
$path,
151+
$this->createJsonBody($parameters),
152+
$requestHeaders
153+
);
137154

138155
return ResponseMediator::getContent($response);
139156
}
140157

141158
/**
142159
* Send a PUT request with JSON-encoded parameters.
143160
*
144-
* @param string $path Request path.
145-
* @param array $parameters POST parameters to be JSON encoded.
146-
* @param array $requestHeaders Request headers.
161+
* @param string $path Request path.
162+
* @param array $parameters POST parameters to be JSON encoded.
163+
* @param array $requestHeaders Request headers.
147164
*/
148165
protected function put($path, array $parameters = array(), $requestHeaders = array())
149166
{
150-
$response = $this->client->getHttpClient()->put($path, $this->createJsonBody($parameters), $requestHeaders);
167+
$response = $this->client->getHttpClient()->put(
168+
$path,
169+
$this->createJsonBody($parameters),
170+
$requestHeaders
171+
);
151172

152173
return ResponseMediator::getContent($response);
153174
}
154175

155176
/**
156177
* Send a DELETE request with JSON-encoded parameters.
157178
*
158-
* @param string $path Request path.
159-
* @param array $parameters POST parameters to be JSON encoded.
160-
* @param array $requestHeaders Request headers.
179+
* @param string $path Request path.
180+
* @param array $parameters POST parameters to be JSON encoded.
181+
* @param array $requestHeaders Request headers.
161182
*/
162183
protected function delete($path, array $parameters = array(), $requestHeaders = array())
163184
{
164-
$response = $this->client->getHttpClient()->delete($path, $this->createJsonBody($parameters), $requestHeaders);
185+
$response = $this->client->getHttpClient()->delete(
186+
$path,
187+
$this->createJsonBody($parameters),
188+
$requestHeaders
189+
);
165190

166191
return ResponseMediator::getContent($response);
167192
}
168193

169194
/**
170195
* Create a JSON encoded version of an array of parameters.
171196
*
172-
* @param array $parameters Request parameters
173-
* @return null string
197+
* @param array $parameters Request parameters
198+
* @return null|string
174199
*/
175200
protected function createJsonBody(array $parameters)
176201
{

0 commit comments

Comments
 (0)