Skip to content

Commit ead9bfd

Browse files
committed
Apply new code style fixes from styleci after extended config
1 parent fdcf7a6 commit ead9bfd

File tree

160 files changed

+1637
-1527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+1637
-1527
lines changed

lib/Github/Api/AbstractApi.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setPerPage($perPage)
9090
*
9191
* @return array|string
9292
*/
93-
protected function get($path, array $parameters = array(), array $requestHeaders = array())
93+
protected function get($path, array $parameters = [], array $requestHeaders = [])
9494
{
9595
if (null !== $this->page && !isset($parameters['page'])) {
9696
$parameters['page'] = $this->page;
@@ -120,7 +120,7 @@ protected function get($path, array $parameters = array(), array $requestHeaders
120120
*
121121
* @return \Psr\Http\Message\ResponseInterface
122122
*/
123-
protected function head($path, array $parameters = array(), array $requestHeaders = array())
123+
protected function head($path, array $parameters = [], array $requestHeaders = [])
124124
{
125125
if (array_key_exists('ref', $parameters) && is_null($parameters['ref'])) {
126126
unset($parameters['ref']);
@@ -140,7 +140,7 @@ protected function head($path, array $parameters = array(), array $requestHeader
140140
*
141141
* @return array|string
142142
*/
143-
protected function post($path, array $parameters = array(), array $requestHeaders = array())
143+
protected function post($path, array $parameters = [], array $requestHeaders = [])
144144
{
145145
return $this->postRaw(
146146
$path,
@@ -158,7 +158,7 @@ protected function post($path, array $parameters = array(), array $requestHeader
158158
*
159159
* @return array|string
160160
*/
161-
protected function postRaw($path, $body, array $requestHeaders = array())
161+
protected function postRaw($path, $body, array $requestHeaders = [])
162162
{
163163
$response = $this->client->getHttpClient()->post(
164164
$path,
@@ -178,7 +178,7 @@ protected function postRaw($path, $body, array $requestHeaders = array())
178178
*
179179
* @return array|string
180180
*/
181-
protected function patch($path, array $parameters = array(), array $requestHeaders = array())
181+
protected function patch($path, array $parameters = [], array $requestHeaders = [])
182182
{
183183
$response = $this->client->getHttpClient()->patch(
184184
$path,
@@ -198,7 +198,7 @@ protected function patch($path, array $parameters = array(), array $requestHeade
198198
*
199199
* @return array|string
200200
*/
201-
protected function put($path, array $parameters = array(), array $requestHeaders = array())
201+
protected function put($path, array $parameters = [], array $requestHeaders = [])
202202
{
203203
$response = $this->client->getHttpClient()->put(
204204
$path,
@@ -218,7 +218,7 @@ protected function put($path, array $parameters = array(), array $requestHeaders
218218
*
219219
* @return array|string
220220
*/
221-
protected function delete($path, array $parameters = array(), array $requestHeaders = array())
221+
protected function delete($path, array $parameters = [], array $requestHeaders = [])
222222
{
223223
$response = $this->client->getHttpClient()->delete(
224224
$path,

lib/Github/Api/AcceptHeaderTrait.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,51 @@ trait AcceptHeaderTrait
1111
{
1212
protected $acceptHeaderValue = null;
1313

14-
protected function get($path, array $parameters = array(), array $requestHeaders = array())
14+
protected function get($path, array $parameters = [], array $requestHeaders = [])
1515
{
1616
return parent::get($path, $parameters, $this->mergeHeaders($requestHeaders));
1717
}
1818

19-
protected function head($path, array $parameters = array(), array $requestHeaders = array())
19+
protected function head($path, array $parameters = [], array $requestHeaders = [])
2020
{
2121
return parent::head($path, $parameters, $this->mergeHeaders($requestHeaders));
2222
}
2323

24-
protected function post($path, array $parameters = array(), array $requestHeaders = array())
24+
protected function post($path, array $parameters = [], array $requestHeaders = [])
2525
{
2626
return parent::post($path, $parameters, $this->mergeHeaders($requestHeaders));
2727
}
2828

29-
protected function postRaw($path, $body, array $requestHeaders = array())
29+
protected function postRaw($path, $body, array $requestHeaders = [])
3030
{
3131
return parent::postRaw($path, $body, $this->mergeHeaders($requestHeaders));
3232
}
3333

34-
protected function patch($path, array $parameters = array(), array $requestHeaders = array())
34+
protected function patch($path, array $parameters = [], array $requestHeaders = [])
3535
{
3636
return parent::patch($path, $parameters, $this->mergeHeaders($requestHeaders));
3737
}
3838

39-
protected function put($path, array $parameters = array(), array $requestHeaders = array())
39+
protected function put($path, array $parameters = [], array $requestHeaders = [])
4040
{
4141
return parent::put($path, $parameters, $this->mergeHeaders($requestHeaders));
4242
}
4343

44-
protected function delete($path, array $parameters = array(), array $requestHeaders = array())
44+
protected function delete($path, array $parameters = [], array $requestHeaders = [])
4545
{
4646
return parent::delete($path, $parameters, $this->mergeHeaders($requestHeaders));
4747
}
4848

4949
/**
50-
* Append a new accept header on all requests
50+
* Append a new accept header on all requests.
51+
*
5152
* @return array
5253
*/
53-
private function mergeHeaders(array $headers = array())
54+
private function mergeHeaders(array $headers = [])
5455
{
55-
$default = array();
56+
$default = [];
5657
if ($this->acceptHeaderValue) {
57-
$default = array('Accept' => $this->acceptHeaderValue);
58+
$default = ['Accept' => $this->acceptHeaderValue];
5859
}
5960

6061
return array_merge($default, $headers);

lib/Github/Api/Apps.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
/**
66
* @link https://developer.github.com/v3/apps/
7+
*
78
* @author Nils Adermann <[email protected]>
89
*/
910
class Apps extends AbstractApi
1011
{
1112
/**
12-
* Create an access token for an installation
13+
* Create an access token for an installation.
1314
*
1415
* @param int $installationId An integration installation id
1516
* @param int $userId An optional user id on behalf of whom the
@@ -19,7 +20,7 @@ class Apps extends AbstractApi
1920
*/
2021
public function createInstallationToken($installationId, $userId = null)
2122
{
22-
$parameters = array();
23+
$parameters = [];
2324
if ($userId) {
2425
$parameters['user_id'] = $userId;
2526
}
@@ -50,7 +51,7 @@ public function findInstallations()
5051
*/
5152
public function listRepositories($userId = null)
5253
{
53-
$parameters = array();
54+
$parameters = [];
5455
if ($userId) {
5556
$parameters['user_id'] = $userId;
5657
}

lib/Github/Api/Authorizations.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Creating, deleting and listing authorizations.
77
*
88
* @link http://developer.github.com/v3/oauth_authorizations/
9+
*
910
* @author Evgeniy Guseletov <[email protected]>
1011
*/
1112
class Authorizations extends AbstractApi
@@ -36,13 +37,13 @@ public function show($clientId)
3637
* Create an authorization.
3738
*
3839
* @param array $params
39-
* @param null $OTPCode
40+
* @param null $OTPCode
4041
*
4142
* @return array
4243
*/
4344
public function create(array $params, $OTPCode = null)
4445
{
45-
$headers = null === $OTPCode ? array() : array('X-GitHub-OTP' => $OTPCode);
46+
$headers = null === $OTPCode ? [] : ['X-GitHub-OTP' => $OTPCode];
4647

4748
return $this->post('/authorizations', $params, $headers);
4849
}

lib/Github/Api/CurrentUser.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
namespace Github\Api;
44

5-
use Github\Api\CurrentUser\PublicKeys;
65
use Github\Api\CurrentUser\Emails;
76
use Github\Api\CurrentUser\Followers;
87
use Github\Api\CurrentUser\Memberships;
98
use Github\Api\CurrentUser\Notifications;
10-
use Github\Api\CurrentUser\Watchers;
9+
use Github\Api\CurrentUser\PublicKeys;
1110
use Github\Api\CurrentUser\Starring;
11+
use Github\Api\CurrentUser\Watchers;
1212

1313
/**
1414
* @link http://developer.github.com/v3/users/
15+
*
1516
* @author Joseph Bielawski <[email protected]>
1617
* @author Felipe Valtl de Mello <[email protected]>
1718
*/
@@ -45,9 +46,9 @@ public function follow()
4546

4647
public function followers($page = 1)
4748
{
48-
return $this->get('/user/followers', array(
49-
'page' => $page
50-
));
49+
return $this->get('/user/followers', [
50+
'page' => $page,
51+
]);
5152
}
5253

5354
/**
@@ -58,9 +59,9 @@ public function followers($page = 1)
5859
*
5960
* @return array
6061
*/
61-
public function issues(array $params = array(), $includeOrgIssues = true)
62+
public function issues(array $params = [], $includeOrgIssues = true)
6263
{
63-
return $this->get($includeOrgIssues ? '/issues' : '/user/issues', array_merge(array('page' => 1), $params));
64+
return $this->get($includeOrgIssues ? '/issues' : '/user/issues', array_merge(['page' => 1], $params));
6465
}
6566

6667
/**
@@ -118,11 +119,11 @@ public function teams()
118119
*/
119120
public function repositories($type = 'owner', $sort = 'full_name', $direction = 'asc')
120121
{
121-
return $this->get('/user/repos', array(
122+
return $this->get('/user/repos', [
122123
'type' => $type,
123124
'sort' => $sort,
124-
'direction' => $direction
125-
));
125+
'direction' => $direction,
126+
]);
126127
}
127128

128129
/**
@@ -138,9 +139,9 @@ public function watchers()
138139
*/
139140
public function watched($page = 1)
140141
{
141-
return $this->get('/user/watched', array(
142-
'page' => $page
143-
));
142+
return $this->get('/user/watched', [
143+
'page' => $page,
144+
]);
144145
}
145146

146147
/**
@@ -156,9 +157,9 @@ public function starring()
156157
*/
157158
public function starred($page = 1)
158159
{
159-
return $this->get('/user/starred', array(
160-
'page' => $page
161-
));
160+
return $this->get('/user/starred', [
161+
'page' => $page,
162+
]);
162163
}
163164

164165
/**
@@ -174,19 +175,19 @@ public function subscriptions()
174175
*
175176
* @param array $params
176177
*/
177-
public function installations(array $params = array())
178+
public function installations(array $params = [])
178179
{
179-
return $this->get('/user/installations', array_merge(array('page' => 1), $params));
180+
return $this->get('/user/installations', array_merge(['page' => 1], $params));
180181
}
181182

182183
/**
183184
* @link https://developer.github.com/v3/integrations/installations/#list-repositories-accessible-to-the-user-for-an-installation
184185
*
185-
* @param string $installationId the ID of the Installation
186-
* @param array $params
186+
* @param string $installationId the ID of the Installation
187+
* @param array $params
187188
*/
188-
public function repositoriesByInstallation($installationId, array $params = array())
189+
public function repositoriesByInstallation($installationId, array $params = [])
189190
{
190-
return $this->get(sprintf('/user/installations/%s/repositories', $installationId), array_merge(array('page' => 1), $params));
191+
return $this->get(sprintf('/user/installations/%s/repositories', $installationId), array_merge(['page' => 1], $params));
191192
}
192193
}

lib/Github/Api/CurrentUser/Emails.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* @link http://developer.github.com/v3/users/emails/
10+
*
1011
* @author Joseph Bielawski <[email protected]>
1112
*/
1213
class Emails extends AbstractApi
@@ -49,7 +50,7 @@ public function allPublic()
4950
public function add($emails)
5051
{
5152
if (is_string($emails)) {
52-
$emails = array($emails);
53+
$emails = [$emails];
5354
} elseif (0 === count($emails)) {
5455
throw new InvalidArgumentException();
5556
}
@@ -71,7 +72,7 @@ public function add($emails)
7172
public function remove($emails)
7273
{
7374
if (is_string($emails)) {
74-
$emails = array($emails);
75+
$emails = [$emails];
7576
} elseif (0 === count($emails)) {
7677
throw new InvalidArgumentException();
7778
}
@@ -80,7 +81,7 @@ public function remove($emails)
8081
}
8182

8283
/**
83-
* Toggle primary email visibility
84+
* Toggle primary email visibility.
8485
*
8586
* @link https://developer.github.com/v3/users/emails/#toggle-primary-email-visibility
8687
*

lib/Github/Api/CurrentUser/Followers.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/**
88
* @link http://developer.github.com/v3/users/followers/
9+
*
910
* @author Joseph Bielawski <[email protected]>
1011
*/
1112
class Followers extends AbstractApi
@@ -21,9 +22,9 @@ class Followers extends AbstractApi
2122
*/
2223
public function all($page = 1)
2324
{
24-
return $this->get('/user/following', array(
25-
'page' => $page
26-
));
25+
return $this->get('/user/following', [
26+
'page' => $page,
27+
]);
2728
}
2829

2930
/**

lib/Github/Api/CurrentUser/Memberships.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function organization($organization)
3333
}
3434

3535
/**
36-
* Edit your organization membership
36+
* Edit your organization membership.
3737
*
3838
* @link https://developer.github.com/v3/orgs/members/#edit-your-organization-membership
3939
*
@@ -43,6 +43,6 @@ public function organization($organization)
4343
*/
4444
public function edit($organization)
4545
{
46-
return $this->patch('/user/memberships/orgs/'.rawurlencode($organization), array('state' => 'active'));
46+
return $this->patch('/user/memberships/orgs/'.rawurlencode($organization), ['state' => 'active']);
4747
}
4848
}

0 commit comments

Comments
 (0)