Skip to content

Commit 8e698ec

Browse files
authored
Merge pull request #189 from laminas/renovate/azjezz-psl-2.x
chore(deps): update dependency azjezz/psl to v2
2 parents acb6b93 + 82219fb commit 8e698ec

27 files changed

+183
-91
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "BSD-3-Clause",
66
"require": {
77
"php": "~8.1.0",
8-
"azjezz/psl": "^1.9.3",
8+
"azjezz/psl": "^2.0.3",
99
"jwage/changelog-generator": "^1.3.1",
1010
"laminas/laminas-diactoros": "^2.13.0",
1111
"lcobucci/clock": "^2.2.0",
@@ -22,7 +22,7 @@
2222
},
2323
"require-dev": {
2424
"doctrine/coding-standard": "^9.0.0",
25-
"php-standard-library/psalm-plugin": "^1.1.1",
25+
"php-standard-library/psalm-plugin": "^2.0.2",
2626
"phpunit/phpunit": "^9.5.0",
2727
"psalm/plugin-phpunit": "^0.17.0",
2828
"roave/infection-static-analysis-plugin": "^1.7",

composer.lock

Lines changed: 102 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Environment/EnvironmentVariables.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ private static function getenv(string $key): string
109109
}
110110

111111
/**
112+
* @psalm-param non-empty-string $key
112113
* @psalm-param non-empty-string $default
113114
*
114115
* @psalm-return non-empty-string

src/Git/CreateTag.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
interface CreateTag
1111
{
12+
/** @param non-empty-string $repositoryDirectory */
1213
public function __invoke(
1314
string $repositoryDirectory,
1415
BranchName $sourceBranch,

src/Git/CreateTagViaConsole.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Laminas\AutomaticReleases\Git\Value\BranchName;
88
use Laminas\AutomaticReleases\Gpg\SecretKeyId;
99
use Psl\Env;
10+
use Psl\File;
1011
use Psl\Filesystem;
1112
use Psl\Shell;
1213

@@ -21,7 +22,7 @@ public function __invoke(
2122
): void {
2223
$tagFileName = Filesystem\create_temporary_file(Env\temp_dir(), 'created_tag');
2324

24-
Filesystem\write_file($tagFileName, $changelog);
25+
File\write($tagFileName, $changelog);
2526

2627
Shell\execute('git', ['checkout', $sourceBranch->name()], $repositoryDirectory);
2728
Shell\execute('git', ['tag', $tagName, '-F', $tagFileName, '--cleanup=whitespace', '--local-user=' . $keyId->id()], $repositoryDirectory);

src/Git/Value/MergeTargetCandidateBranches.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function branchToMergeUp(SemVerVersion $version): ?BranchName
6464
return null;
6565
}
6666

67-
$lastBranch = Type\object(BranchName::class)->assert(Iter\last($this->sortedBranches));
67+
$lastBranch = Type\instance_of(BranchName::class)->assert(Iter\last($this->sortedBranches));
6868
$targetBranchKey = array_search($targetBranch, $this->sortedBranches, true);
6969

7070
$branch = Type\int()->matches($targetBranchKey)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function fromPayload(array $payload): self
7070
$payload['number'],
7171
$payload['title'],
7272
Author::fromPayload($payload['author']),
73-
Vec\map($payload['labels']['nodes'], [Label::class, 'fromPayload']),
73+
Vec\map($payload['labels']['nodes'], Label::fromPayload(...)),
7474
isset($payload['merged']) ? $payload['merged'] || $payload['closed'] : $payload['closed'],
7575
new Uri($payload['url'])
7676
);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public static function fromPayload(array $payload): self
7777
$payload['title'],
7878
$payload['description'],
7979
Vec\concat(
80-
Vec\map($payload['issues']['nodes'], [IssueOrPullRequest::class, 'fromPayload']),
81-
Vec\map($payload['pullRequests']['nodes'], [IssueOrPullRequest::class, 'fromPayload'])
80+
Vec\map($payload['issues']['nodes'], IssueOrPullRequest::fromPayload(...)),
81+
Vec\map($payload['pullRequests']['nodes'], IssueOrPullRequest::fromPayload(...))
8282
),
8383
new Uri($payload['url'])
8484
);

src/Github/Event/Factory/LoadCurrentGithubEventFromGithubActionPath.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
use Laminas\AutomaticReleases\Environment\EnvironmentVariables;
88
use Laminas\AutomaticReleases\Github\Event\MilestoneClosedEvent;
9-
use Psl\Filesystem;
9+
10+
use function Psl\File\read;
1011

1112
final class LoadCurrentGithubEventFromGithubActionPath implements LoadCurrentGithubEvent
1213
{
@@ -21,6 +22,6 @@ public function __invoke(): MilestoneClosedEvent
2122
{
2223
$path = $this->variables->githubEventPath();
2324

24-
return MilestoneClosedEvent::fromEventJson(Filesystem\read_file($path));
25+
return MilestoneClosedEvent::fromEventJson(read($path));
2526
}
2627
}

src/Github/MergeMultipleReleaseNotes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __invoke(
4545
null
4646
);
4747

48-
return Type\object(ChangelogReleaseNotes::class)->assert($releaseNotes);
48+
return Type\instance_of(ChangelogReleaseNotes::class)->assert($releaseNotes);
4949
}
5050

5151
public function canCreateReleaseText(

0 commit comments

Comments
 (0)