Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Mar 24, 2024
1 parent 4fca25f commit 4afaaf9
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion lib/Github/Api/Issue/Labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function deleteLabel($username, $repository, $label)
public function update($username, $repository, $label, $newName, $color)
{
$params = [
'name' => $newName,
'name' => $newName,
'color' => $color,
];

Expand Down
6 changes: 3 additions & 3 deletions lib/Github/Api/Issue/Milestones.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function all($username, $repository, array $params = [])
}

return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', array_merge([
'page' => 1,
'state' => 'open',
'sort' => 'due_date',
'page' => 1,
'state' => 'open',
'sort' => 'due_date',
'direction' => 'asc',
], $params));
}
Expand Down
14 changes: 7 additions & 7 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ public function create(
$path = null !== $organization ? '/orgs/'.$organization.'/repos' : '/user/repos';

$parameters = [
'name' => $name,
'description' => $description,
'homepage' => $homepage,
'private' => ($visibility ?? ($public ? 'public' : 'private')) === 'private',
'has_issues' => $hasIssues,
'has_wiki' => $hasWiki,
'name' => $name,
'description' => $description,
'homepage' => $homepage,
'private' => ($visibility ?? ($public ? 'public' : 'private')) === 'private',
'has_issues' => $hasIssues,
'has_wiki' => $hasWiki,
'has_downloads' => $hasDownloads,
'auto_init' => $autoInit,
'auto_init' => $autoInit,
'has_projects' => $hasProjects,
];

Expand Down
4 changes: 2 additions & 2 deletions lib/Github/Api/Repository/Contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function update($username, $repository, $path, $content, $message, $sha,
$parameters = [
'content' => base64_encode($content),
'message' => $message,
'sha' => $sha,
'sha' => $sha,
];

if (null !== $branch) {
Expand Down Expand Up @@ -221,7 +221,7 @@ public function rm($username, $repository, $path, $message, $sha, $branch = null

$parameters = [
'message' => $message,
'sha' => $sha,
'sha' => $sha,
];

if (null !== $branch) {
Expand Down
18 changes: 9 additions & 9 deletions test/Github/Tests/Api/CurrentUser/MembershipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ public function shouldGetMemberships()
[
'organization' => [
'login' => 'octocat',
'id' => 1,
'id' => 1,
],
'user' => [
'user' => [
'login' => 'defunkt',
'id' => 3,
'id' => 3,
],
],
[
'organization' => [
'login' => 'invitocat',
'id' => 2,
'id' => 2,
],
'user' => [
'user' => [
'login' => 'defunkt',
'id' => 3,
'id' => 3,
],
],
];
Expand All @@ -51,11 +51,11 @@ public function shouldGetMembershipsForOrganization()
$expectedValue = [
'organization' => [
'login' => 'invitocat',
'id' => 2,
'id' => 2,
],
'user' => [
'user' => [
'login' => 'defunkt',
'id' => 3,
'id' => 3,
],
];

Expand Down
4 changes: 2 additions & 2 deletions test/Github/Tests/Api/GistsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ public function shouldUpdateGist()
'files' => [
'filename.txt' => [
'filename' => 'new_name.txt',
'content' => 'content',
'content' => 'content',
],
'filename_new.txt' => [
'content' => 'content new',
'content' => 'content new',
],
],
];
Expand Down
10 changes: 5 additions & 5 deletions test/Github/Tests/Api/GitData/TreesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public function shouldCreateTreeUsingSha()
'path' => 'path',
'mode' => 'mode',
'type' => 'type',
'sha' => '1234',
'sha' => '1234',
],
[
'path' => 'htap',
'mode' => 'edom',
'type' => 'epyt',
'sha' => '4321',
'sha' => '4321',
],
],
];
Expand Down Expand Up @@ -118,7 +118,7 @@ public function shouldNotCreateTreeWithoutPathParam()
'tree' => [
'mode' => 'mode',
'type' => 'type',
'content' => 'content',
'content' => 'content',
],
];

Expand All @@ -139,7 +139,7 @@ public function shouldNotCreateTreeWithoutModeParam()
'tree' => [
'path' => 'path',
'type' => 'type',
'content' => 'content',
'content' => 'content',
],
];

Expand All @@ -160,7 +160,7 @@ public function shouldNotCreateTreeWithoutTypeParam()
'tree' => [
'path' => 'path',
'mode' => 'mode',
'content' => 'content',
'content' => 'content',
],
];

Expand Down
4 changes: 2 additions & 2 deletions test/Github/Tests/Api/GraphQLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function shouldTestGraphQL()

$api->expects($this->once())
->method('post')
->with($this->equalTo('/graphql'), $this->equalTo(['query'=>'bar']))
->with($this->equalTo('/graphql'), $this->equalTo(['query' => 'bar']))
->will($this->returnValue('foo'));

$result = $api->execute('bar');
Expand Down Expand Up @@ -44,7 +44,7 @@ public function shouldJSONEncodeGraphQLVariables()
$api->expects($this->once())
->method('post')
->with('/graphql', $this->equalTo([
'query'=>'bar',
'query' => 'bar',
'variables' => '{"variable":"foo"}',
]));

Expand Down
10 changes: 5 additions & 5 deletions test/Github/Tests/Api/IssueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public function shouldGetIssuesUsingAdditionalParameters()
$data = [
'state' => 'open',
'milestone' => '*',
'assignee' => 'l3l0',
'assignee' => 'l3l0',
'mentioned' => 'l3l0',
'labels' => 'bug,@high',
'sort' => 'created',
'labels' => 'bug,@high',
'sort' => 'created',
'direction' => 'asc',
];
$sentData = $data + [
Expand Down Expand Up @@ -77,7 +77,7 @@ public function shouldCreateIssue()
{
$data = [
'title' => 'some title',
'body' => 'some body',
'body' => 'some body',
];

$api = $this->getApiMock();
Expand All @@ -95,7 +95,7 @@ public function shouldNotCreateIssueWithoutTitle()
{
$this->expectException(MissingArgumentException::class);
$data = [
'body' => 'some body',
'body' => 'some body',
];

$api = $this->getApiMock();
Expand Down
28 changes: 14 additions & 14 deletions test/Github/Tests/Api/PullRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ public function shouldMergePullRequestWithMergeMethod()
public function shouldCreatePullRequestUsingTitle()
{
$data = [
'base' => 'master',
'head' => 'virtualtestbranch',
'base' => 'master',
'head' => 'virtualtestbranch',
'title' => 'TITLE: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
];

$api = $this->getApiMock();
Expand All @@ -263,8 +263,8 @@ public function shouldCreatePullRequestUsingTitle()
public function shouldCreatePullRequestUsingIssueId()
{
$data = [
'base' => 'master',
'head' => 'virtualtestbranch',
'base' => 'master',
'head' => 'virtualtestbranch',
'issue' => 25,
];

Expand All @@ -282,10 +282,10 @@ public function shouldCreatePullRequestUsingIssueId()
public function shouldCreateDraftPullRequest()
{
$data = [
'base' => 'master',
'head' => 'virtualtestbranch',
'base' => 'master',
'head' => 'virtualtestbranch',
'title' => 'TITLE: Testing draft pull-request creation from PHP Github API',
'body' => 'BODY: Testing draft pull-request creation from PHP Github API',
'body' => 'BODY: Testing draft pull-request creation from PHP Github API',
'draft' => 'true',
];

Expand All @@ -304,9 +304,9 @@ public function shouldNotCreatePullRequestWithoutBase()
{
$this->expectException(MissingArgumentException::class);
$data = [
'head' => 'virtualtestbranch',
'head' => 'virtualtestbranch',
'title' => 'TITLE: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
];

$api = $this->getApiMock();
Expand All @@ -323,9 +323,9 @@ public function shouldNotCreatePullRequestWithoutHead()
{
$this->expectException(MissingArgumentException::class);
$data = [
'base' => 'master',
'base' => 'master',
'title' => 'TITLE: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
'body' => 'BODY: Testing pull-request creation from PHP Github API',
];

$api = $this->getApiMock();
Expand All @@ -342,8 +342,8 @@ public function shouldNotCreatePullRequestUsingTitleButWithoutBody()
{
$this->expectException(MissingArgumentException::class);
$data = [
'base' => 'master',
'head' => 'virtualtestbranch',
'base' => 'master',
'head' => 'virtualtestbranch',
'title' => 'TITLE: Testing pull-request creation from PHP Github API',
];

Expand Down
60 changes: 30 additions & 30 deletions test/Github/Tests/Api/RepoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ public function shouldCreateRepositoryUsingNameOnly()
$api->expects($this->once())
->method('post')
->with('/user/repos', [
'name' => 'l3l0Repo',
'description' => '',
'homepage' => '',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
'name' => 'l3l0Repo',
'description' => '',
'homepage' => '',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
'has_downloads' => false,
'auto_init' => false,
'auto_init' => false,
'has_projects' => true,
])
->will($this->returnValue($expectedArray));
Expand All @@ -118,14 +118,14 @@ public function shouldCreateRepositoryForOrganization()
$api->expects($this->once())
->method('post')
->with('/orgs/KnpLabs/repos', [
'name' => 'KnpLabsRepo',
'description' => '',
'homepage' => '',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
'name' => 'KnpLabsRepo',
'description' => '',
'homepage' => '',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
'has_downloads' => false,
'auto_init' => false,
'auto_init' => false,
'has_projects' => true,
])
->will($this->returnValue($expectedArray));
Expand All @@ -144,16 +144,16 @@ public function shouldCreateRepositoryWithInternalVisibility()
$api->expects($this->once())
->method('post')
->with('/user/repos', [
'name' => 'KnpLabsRepo',
'description' => '',
'homepage' => '',
'has_issues' => false,
'has_wiki' => false,
'name' => 'KnpLabsRepo',
'description' => '',
'homepage' => '',
'has_issues' => false,
'has_wiki' => false,
'has_downloads' => false,
'auto_init' => false,
'has_projects' => true,
'visibility' => 'internal',
'private' => false,
'auto_init' => false,
'has_projects' => true,
'visibility' => 'internal',
'private' => false,
])
->will($this->returnValue($expectedArray));

Expand Down Expand Up @@ -389,14 +389,14 @@ public function shouldCreateUsingAllParams()
$api->expects($this->once())
->method('post')
->with('/user/repos', [
'name' => 'l3l0Repo',
'description' => 'test',
'homepage' => 'http://l3l0.eu',
'private' => true,
'has_issues' => false,
'has_wiki' => false,
'name' => 'l3l0Repo',
'description' => 'test',
'homepage' => 'http://l3l0.eu',
'private' => true,
'has_issues' => false,
'has_wiki' => false,
'has_downloads' => false,
'auto_init' => false,
'auto_init' => false,
'has_projects' => true,
])
->will($this->returnValue($expectedArray));
Expand Down
Loading

0 comments on commit 4afaaf9

Please sign in to comment.