Skip to content

Commit 096904f

Browse files
committed
PHPCS tweaks via PHP-CS-Fixer
1 parent 47675b8 commit 096904f

38 files changed

Lines changed: 193 additions & 193 deletions

src/AbstractGithubObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ abstract class AbstractGithubObject
4848
* @link https://developer.github.com/webhooks/#events
4949
* @note From 1.4.0 to 1.5.1 this was named $events, it was renamed due to naming conflicts with package subclasses
5050
*/
51-
protected $hookEvents = array(
51+
protected $hookEvents = [
5252
'*',
5353
'commit_comment',
5454
'create',
@@ -71,7 +71,7 @@ abstract class AbstractGithubObject
7171
'status',
7272
'team_add',
7373
'watch',
74-
);
74+
];
7575

7676
/**
7777
* Constructor.

src/Package/Activity/Notifications.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ public function markRead($unread = true, $read = true, \DateTimeInterface $lastR
130130
// Build the request path.
131131
$path = '/notifications';
132132

133-
$data = array(
133+
$data = [
134134
'unread' => $unread,
135135
'read' => $read,
136-
);
136+
];
137137

138138
if ($lastReadAt)
139139
{
@@ -167,10 +167,10 @@ public function markReadRepository($owner, $repo, $unread, $read, \DateTimeInter
167167
// Build the request path.
168168
$path = '/repos/' . $owner . '/' . $repo . '/notifications';
169169

170-
$data = array(
170+
$data = [
171171
'unread' => $unread,
172172
'read' => $read,
173-
);
173+
];
174174

175175
if ($lastReadAt)
176176
{
@@ -218,10 +218,10 @@ public function markReadThread($id, $unread = true, $read = true)
218218
// Build the request path.
219219
$path = '/notifications/threads/' . $id;
220220

221-
$data = array(
221+
$data = [
222222
'unread' => $unread,
223223
'read' => $read,
224-
);
224+
];
225225

226226
return $this->processResponse(
227227
$this->client->patch($this->fetchUrl($path), json_encode($data)),
@@ -271,10 +271,10 @@ public function setThreadSubscription($id, $subscribed, $ignored)
271271
// Build the request path.
272272
$path = '/notifications/threads/' . $id . '/subscription';
273273

274-
$data = array(
274+
$data = [
275275
'subscribed' => $subscribed,
276276
'ignored' => $ignored,
277-
);
277+
];
278278

279279
return $this->processResponse(
280280
$this->client->put($this->fetchUrl($path), json_encode($data))

src/Package/Activity/Starring.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public function getList($owner, $repo)
5555
*/
5656
public function getRepositories($user = '', $sort = 'created', $direction = 'desc')
5757
{
58-
$allowedSort = array('created', 'updated');
59-
$allowedDir = array('asc', 'desc');
58+
$allowedSort = ['created', 'updated'];
59+
$allowedDir = ['asc', 'desc'];
6060

6161
if (!\in_array($sort, $allowedSort))
6262
{

src/Package/Activity/Watching.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public function setSubscription($owner, $repo, $subscribed, $ignored)
9999
// Build the request path.
100100
$path = '/repos/' . $owner . '/' . $repo . '/subscription';
101101

102-
$data = array(
102+
$data = [
103103
'subscribed' => $subscribed,
104104
'ignored' => $ignored,
105-
);
105+
];
106106

107107
return $this->processResponse(
108108
$this->client->put($this->fetchUrl($path), json_encode($data))

src/Package/Authorization.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class Authorization extends AbstractPackage
3535
* @since 1.0
3636
* @throws \DomainException
3737
*/
38-
public function create(array $scopes = array(), $note = '', $url = '')
38+
public function create(array $scopes = [], $note = '', $url = '')
3939
{
4040
// Build the request path.
4141
$path = '/authorizations';
4242

4343
$data = json_encode(
44-
array('scopes' => $scopes, 'note' => $note, 'note_url' => $url)
44+
['scopes' => $scopes, 'note' => $note, 'note_url' => $url]
4545
);
4646

4747
// Send the request.
@@ -104,7 +104,7 @@ public function deleteGrant($id)
104104
* @throws \DomainException
105105
* @throws \RuntimeException
106106
*/
107-
public function edit($id, array $scopes = array(), array $addScopes = array(), array $removeScopes = array(), $note = '', $url = '')
107+
public function edit($id, array $scopes = [], array $addScopes = [], array $removeScopes = [], $note = '', $url = '')
108108
{
109109
// Check if more than one scopes array contains data
110110
$scopesCount = 0;
@@ -142,11 +142,11 @@ public function edit($id, array $scopes = array(), array $addScopes = array(), a
142142
$path = '/authorizations/' . $id;
143143

144144
$data = json_encode(
145-
array(
145+
[
146146
$scope => $scopeData,
147147
'note' => $note,
148148
'note_url' => $url,
149-
)
149+
]
150150
);
151151

152152
// Send the request.
@@ -250,7 +250,7 @@ public function getRateLimit()
250250
if ($response->code == 404)
251251
{
252252
// Unlimited rate for Github Enterprise sites and trusted users.
253-
return (object) array('limit' => false, 'remaining' => null);
253+
return (object) ['limit' => false, 'remaining' => null];
254254
}
255255

256256
// Decode the error response and throw an exception.
@@ -316,18 +316,18 @@ public function requestToken($clientId, $clientSecret, $code, $redirectUri = '',
316316
{
317317
$uri = 'https://github.com/login/oauth/access_token';
318318

319-
$data = array(
319+
$data = [
320320
'client_id' => $clientId,
321321
'client_secret' => $clientSecret,
322322
'code' => $code,
323-
);
323+
];
324324

325325
if ($redirectUri)
326326
{
327327
$data['redirect_uri'] = $redirectUri;
328328
}
329329

330-
$headers = array();
330+
$headers = [];
331331

332332
switch ($format)
333333
{

src/Package/Data/Blobs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public function create($owner, $repo, $content, $encoding = 'utf-8')
6161
// Build the request path.
6262
$path = '/repos/' . $owner . '/' . $repo . '/git/blobs';
6363

64-
$data = array(
64+
$data = [
6565
'content' => $content,
6666
'encoding' => $encoding,
67-
);
67+
];
6868

6969
return $this->processResponse(
7070
$this->client->post($this->fetchUrl($path), json_encode($data)),

src/Package/Data/Commits.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function get($owner, $repo, $sha)
5454
*
5555
* @return object
5656
*/
57-
public function create($owner, $repo, $message, $tree, array $parents = array())
57+
public function create($owner, $repo, $message, $tree, array $parents = [])
5858
{
5959
// Build the request path.
6060
$path = '/repos/' . $owner . '/' . $repo . '/git/commits';
6161

6262
$data = json_encode(
63-
array('message' => $message, 'tree' => $tree, 'parents' => $parents)
63+
['message' => $message, 'tree' => $tree, 'parents' => $parents]
6464
);
6565

6666
// Send the request.

src/Package/Data/Refs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ public function create($user, $repo, $ref, $sha)
8888

8989
// Build the request data.
9090
$data = json_encode(
91-
array(
91+
[
9292
'ref' => $ref,
9393
'sha' => $sha,
94-
)
94+
]
9595
);
9696

9797
// Send the request.

src/Package/Data/Tags.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ public function create($owner, $repo, $tag, $message, $object, $type, $taggerNam
6969
// Build the request path.
7070
$path = '/repos/' . $owner . '/' . $repo . '/git/tags';
7171

72-
$data = array(
72+
$data = [
7373
'tag' => $tag,
7474
'message' => $message,
7575
'object' => $object,
7676
'type' => $type,
77-
'tagger' => array(
77+
'tagger' => [
7878
'name' => $taggerName,
7979
'email' => $taggerEmail,
8080
'date' => $taggerDate,
81-
),
82-
);
81+
],
82+
];
8383

8484
return $this->processResponse(
8585
$this->client->post($this->fetchUrl($path), json_encode($data)),

src/Package/Data/Trees.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function create($owner, $repo, $tree, $baseTree = '')
9898
// Build the request path.
9999
$path = '/repos/' . $owner . '/' . $repo . '/git/trees';
100100

101-
$data = array();
101+
$data = [];
102102

103103
$data['tree'] = $tree;
104104

0 commit comments

Comments
 (0)