Skip to content

Commit 96ab90b

Browse files
Merge pull request #1 from TheDragonCode/code-style-9fvl12i
🦋 The code style has been fixed
2 parents b126660 + 3d8a12a commit 96ab90b

File tree

8 files changed

+823
-37
lines changed

8 files changed

+823
-37
lines changed

.editorconfig

Lines changed: 798 additions & 9 deletions
Large diffs are not rendered by default.

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ updates:
55
directory: /
66
schedule:
77
interval: daily
8+
labels:
9+
- dependabot

app/Commands/ReadCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
class ReadCommand extends Command
1414
{
1515
protected $signature = 'read'
16-
. ' {repository? : Full or partial repository name}'
17-
. ' {--i|without-issues : Exclude issues from processing}'
18-
. ' {--s|without-pulls : Exclude Pull Requests from processing}'
19-
. ' {--o|with-open : Process including open Issues and Pull Requests}'
20-
. ' {--token= : GitHub access token with "notifications" permissions}';
16+
. ' {repository? : Full or partial repository name}'
17+
. ' {--i|without-issues : Exclude issues from processing}'
18+
. ' {--s|without-pulls : Exclude Pull Requests from processing}'
19+
. ' {--o|with-open : Process including open Issues and Pull Requests}'
20+
. ' {--token= : GitHub access token with "notifications" permissions}';
2121

2222
protected $description = 'Read all issue notifications';
2323

@@ -59,8 +59,8 @@ protected function read(?string $repository): void
5959
protected function shouldBeAll(?string $repository): bool
6060
{
6161
return empty($repository)
62-
&& !$this->withoutIssues()
63-
&& !$this->withoutPulls()
62+
&& ! $this->withoutIssues()
63+
&& ! $this->withoutPulls()
6464
&& $this->withOpen();
6565
}
6666

@@ -69,9 +69,9 @@ protected function gitHub(): GitHub
6969
$client = ClientFactory::make($this->token());
7070

7171
return app(GitHub::class, [
72-
'output' => $this->components,
73-
'github' => $client,
74-
'paginator' => new ResultPager($client)
72+
'output' => $this->components,
73+
'github' => $client,
74+
'paginator' => new ResultPager($client),
7575
]);
7676
}
7777

app/Data/ItemData.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class ItemData extends Data
1414

1515
public function __construct(array $data)
1616
{
17-
$this->id = (int)$this->get($data, 'number');
17+
$this->id = (int) $this->get($data, 'number');
1818

19-
$this->isOpen = $this->get($data, 'state') === 'open';
20-
$this->isMerged = (bool)$this->get($data, 'merged');
19+
$this->isOpen = $this->get($data, 'state') === 'open';
20+
$this->isMerged = (bool) $this->get($data, 'merged');
2121
}
2222
}

app/Data/NotificationData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ class NotificationData extends Data
2020

2121
public function __construct(array $data)
2222
{
23-
$this->id = (int)$this->get($data, 'id');
23+
$this->id = (int) $this->get($data, 'id');
2424
$this->issueId = $this->issueId($data);
2525

2626
$this->type = $this->get($data, 'subject.type');
2727

28-
$this->fullName = $this->get($data, 'repository.full_name');
28+
$this->fullName = $this->get($data, 'repository.full_name');
2929
$this->organization = $this->get($data, 'repository.owner.login');
30-
$this->repository = $this->get($data, 'repository.name');
30+
$this->repository = $this->get($data, 'repository.name');
3131
}
3232

3333
protected function issueId(array $data): int
3434
{
3535
$values = $this->parseUrl($data);
3636

37-
return (int)end($values);
37+
return (int) end($values);
3838
}
3939

4040
protected function parseUrl(array $data): array

app/Services/GitHub.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
class GitHub
1717
{
1818
protected ?string $repository = null;
19+
1920
protected bool $withoutIssues = false;
21+
2022
protected bool $withoutPulls = false;
23+
2124
protected bool $withOpen = false;
2225

2326
public function __construct(
2427
protected Factory $output,
2528
protected Client $github,
2629
protected ResultPager $paginator,
27-
) {
28-
}
30+
) {}
2931

3032
public function repository(?string $repository): self
3133
{
@@ -67,7 +69,7 @@ public function markAll(): void
6769

6870
public function mark(): void
6971
{
70-
if (!$items = $this->paginated()) {
72+
if (! $items = $this->paginated()) {
7173
$this->output->info('Nothing to mark');
7274

7375
return;
@@ -139,10 +141,6 @@ protected function shouldSkip(NotificationData $notification, ItemData $item): b
139141
return true;
140142
}
141143

142-
if ($item->isOpen || !$item->isMerged) {
143-
return true;
144-
}
145-
146-
return false;
144+
return (bool) ($item->isOpen || ! $item->isMerged);
147145
}
148146
}

config/app.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
return [
4-
54
/*
65
|--------------------------------------------------------------------------
76
| Application Name
@@ -41,5 +40,4 @@
4140
*/
4241

4342
'env' => env('APP_ENV', 'production'),
44-
4543
];

config/commands.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Symfony\Component\Console\Command\HelpCommand;
1111

1212
return [
13-
1413
/*
1514
|--------------------------------------------------------------------------
1615
| Default Command

0 commit comments

Comments
 (0)