Skip to content

Commit 747a332

Browse files
authored
Merge pull request #228 from samsonasik/apply-php82
Apply PHP 8.2 syntax
2 parents 4264688 + 77a05b8 commit 747a332

24 files changed

+39
-58
lines changed

src/Changelog/CommitReleaseChangelogViaKeepAChangelog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Psl\Type;
1515
use Psr\Log\LoggerInterface;
1616

17-
final class CommitReleaseChangelogViaKeepAChangelog implements CommitReleaseChangelog
17+
final readonly class CommitReleaseChangelogViaKeepAChangelog implements CommitReleaseChangelog
1818
{
1919
private const CHANGELOG_FILE = 'CHANGELOG.md';
2020

src/Git/FetchAndSetCurrentUserByReplacingCurrentOriginRemote.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Psl\Shell;
1111
use Psr\Http\Message\UriInterface;
1212

13-
final class FetchAndSetCurrentUserByReplacingCurrentOriginRemote implements Fetch
13+
final readonly class FetchAndSetCurrentUserByReplacingCurrentOriginRemote implements Fetch
1414
{
1515
public function __construct(private readonly EnvironmentVariables $variables)
1616
{

src/Git/Value/BranchName.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
use Psl\Type;
1010

1111
/** @psalm-immutable */
12-
final class BranchName
12+
final readonly class BranchName
1313
{
14-
/** @psalm-var non-empty-string */
15-
private string $name;
16-
1714
/** @psalm-param non-empty-string $name */
18-
private function __construct(string $name)
19-
{
20-
$this->name = $name;
15+
private function __construct(
16+
private readonly string $name,
17+
) {
2118
}
2219

2320
/**

src/Git/Value/MergeTargetCandidateBranches.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use function Psl\Vec\filter;
1414
use function Psl\Vec\reverse;
1515

16-
final class MergeTargetCandidateBranches
16+
final readonly class MergeTargetCandidateBranches
1717
{
1818
/**
1919
* @param BranchName[] $sortedBranches branches that can be used for releases, sorted in ascending version number
@@ -25,9 +25,7 @@ private function __construct(private readonly array $sortedBranches)
2525

2626
public static function fromAllBranches(BranchName ...$branches): self
2727
{
28-
$mergeTargetBranches = filter($branches, static function (BranchName $branch): bool {
29-
return $branch->isReleaseBranch();
30-
});
28+
$mergeTargetBranches = filter($branches, static fn (BranchName $branch): bool => $branch->isReleaseBranch());
3129

3230
$mergeTargetBranches = Vec\sort($mergeTargetBranches, self::branchOrder(...));
3331

src/Git/Value/SemVerVersion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Psl\Regex;
99

1010
/** @psalm-immutable */
11-
final class SemVerVersion
11+
final readonly class SemVerVersion
1212
{
1313
private function __construct(
1414
private readonly int $major,

src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Psl\Type;
99
use Psr\Http\Message\UriInterface;
1010

11-
final class Author
11+
final readonly class Author
1212
{
1313
/** @psalm-param non-empty-string $name */
1414
private function __construct(

src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/IssueOrPullRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Psr\Http\Message\UriInterface;
1111

1212
/** @psalm-immutable */
13-
final class IssueOrPullRequest
13+
final readonly class IssueOrPullRequest
1414
{
1515
/**
1616
* @param array<int, Label> $labels

src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Label.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Psr\Http\Message\UriInterface;
1212

1313
/** @psalm-immutable */
14-
final class Label
14+
final readonly class Label
1515
{
1616
/**
1717
* @psalm-param non-empty-string $colour

src/Github/Api/GraphQL/Query/GetMilestoneChangelog/Response/Milestone.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Psr\Http\Message\UriInterface;
1313

1414
/** @psalm-immutable */
15-
final class Milestone
15+
final readonly class Milestone
1616
{
1717
/**
1818
* @param array<int, IssueOrPullRequest> $entries
@@ -101,8 +101,6 @@ public function url(): UriInterface
101101
/** @psalm-suppress ImpureFunctionCall the {@see \Psl\Iter\all()} API is conditionally pure */
102102
public function assertAllIssuesAreClosed(): void
103103
{
104-
Psl\invariant(Iter\all($this->entries, static function (IssueOrPullRequest $entry): bool {
105-
return $entry->closed();
106-
}), 'Failed asserting that all milestone issues are closed.');
104+
Psl\invariant(Iter\all($this->entries, static fn (IssueOrPullRequest $entry): bool => $entry->closed()), 'Failed asserting that all milestone issues are closed.');
107105
}
108106
}

src/Github/Api/GraphQL/Query/GetMilestoneFirst100IssuesAndPullRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Laminas\AutomaticReleases\Github\Value\RepositoryName;
1010
use Psl\Type;
1111

12-
final class GetMilestoneFirst100IssuesAndPullRequests implements GetGithubMilestone
12+
final readonly class GetMilestoneFirst100IssuesAndPullRequests implements GetGithubMilestone
1313
{
1414
// @TODO this fetches ONLY the first 100 issues!!!
1515
private const QUERY = <<<'GRAPHQL'

0 commit comments

Comments
 (0)