Skip to content

Commit 74c8a87

Browse files
committed
cs
1 parent 069c1ff commit 74c8a87

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/Command/GenerateCommand.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7979

8080
foreach ($configuration->getRemoteRepositories() as $remoteRepository) {
8181

82-
8382
$foundPullRequests = $this->githubApiCaller->findRepositoryPullRequestsBetweenDates(
8483
$remoteRepository,
8584
$configuration->getGithubToken(),
@@ -98,7 +97,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9897
$username = $foundPullRequest->user->login;
9998
$pullRequestUrl = $foundPullRequest->pull_request->url;
10099

101-
$changelogLine = sprintf('* %s ([#%s](%s))',
100+
$changelogLine = sprintf(
101+
'* %s ([#%s](%s))',
102102
$foundPullRequest->title,
103103
$foundPullRequest->number,
104104
$pullRequestUrl
@@ -111,7 +111,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
111111
$externalChangelogLines[] = $changelogLine;
112112
}
113113

114-
$externalRepositoryChangelogs[] = new ExternalRepositoryChangelog($remoteRepository, $externalChangelogLines);
114+
$externalRepositoryChangelogs[] = new ExternalRepositoryChangelog(
115+
$remoteRepository,
116+
$externalChangelogLines
117+
);
115118
}
116119
}
117120

@@ -155,9 +158,9 @@ private function printToFile(string $releaseChangelogContents): void
155158
$this->symfonyStyle->writeln(sprintf('Release notes dumped into "%s" file', $filePath));
156159
}
157160

158-
159-
private function createExternalRepositoryChangelogContents(ExternalRepositoryChangelog $externalRepositoriesChangelog): string
160-
{
161+
private function createExternalRepositoryChangelogContents(
162+
ExternalRepositoryChangelog $externalRepositoriesChangelog
163+
): string {
161164
$changelogContents = '## ' . $externalRepositoriesChangelog->getTitle();
162165
$changelogContents .= implode(PHP_EOL, $externalRepositoriesChangelog->getLines());
163166
$changelogContents .= PHP_EOL . PHP_EOL;

src/GithubApiCaller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ public function searchIssues(Commit $commit, string $githubToken): stdClass
2424
return $this->sendRequest($requestUri, $githubToken);
2525
}
2626

27-
public function findRepositoryPullRequestsBetweenDates(string $repositoryName, string $githubToken, string $startDate, string $endDate): stdClass
28-
{
27+
public function findRepositoryPullRequestsBetweenDates(
28+
string $repositoryName,
29+
string $githubToken,
30+
string $startDate,
31+
string $endDate
32+
): stdClass {
2933
$requestUri = sprintf(
3034
'https://api.github.com/search/issues?q=repo:%s+is:pull-request+merged:%s..%s',
3135
$repositoryName,

src/ValueObject/ExternalRepositoryChangelog.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ final class ExternalRepositoryChangelog
1212
public function __construct(
1313
private string $title,
1414
private array $lines
15-
)
16-
{
15+
) {
1716

1817
}
1918

@@ -25,7 +24,7 @@ public function getTitle(): string
2524
/**
2625
* @return string[]
2726
*/
28-
public function getLines(): array
27+
public function getLines(): array
2928
{
3029
return $this->lines;
3130
}

0 commit comments

Comments
 (0)