Skip to content

Commit 1a77168

Browse files
committed
Fix Psalm docs
Signed-off-by: Nathanael Esayeas <[email protected]>
1 parent b51fcfd commit 1a77168

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed

src/Git/CreateTag.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
interface CreateTag
1111
{
12-
/** @param non-empty-string $repositoryDirectory */
12+
/**
13+
* @param non-empty-string $repositoryDirectory
14+
* @param non-empty-string $tagName
15+
*/
1316
public function __invoke(
1417
string $repositoryDirectory,
1518
BranchName $sourceBranch,

src/Git/HasTag.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
interface HasTag
88
{
9-
/** @param non-empty-string $repositoryDirectory */
9+
/**
10+
* @param non-empty-string $repositoryDirectory
11+
* @param non-empty-string $tagName
12+
*/
1013
public function __invoke(
1114
string $repositoryDirectory,
1215
string $tagName,

test/unit/Git/HasTagViaConsoleTest.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
use Laminas\AutomaticReleases\Git\HasTag;
88
use Laminas\AutomaticReleases\Git\HasTagViaConsole;
99
use PHPUnit\Framework\TestCase;
10+
use Psl\Env;
11+
use Psl\Filesystem;
12+
use Psl\Shell;
1013

1114
use function array_map;
12-
use function Psl\Env\temp_dir;
13-
use function Psl\Filesystem\create_directory;
14-
use function Psl\Filesystem\create_temporary_file;
15-
use function Psl\Filesystem\delete_file;
16-
use function Psl\Shell\execute;
1715
use function sprintf;
1816

1917
/** @covers \Laminas\AutomaticReleases\Git\HasTagViaConsole */
@@ -27,17 +25,17 @@ protected function setUp(): void
2725
{
2826
parent::setUp();
2927

30-
$this->repository = create_temporary_file(temp_dir(), 'HasTagViaConsoleRepository');
28+
$this->repository = Filesystem\create_temporary_file(Env\temp_dir(), 'HasTagViaConsoleRepository');
3129

3230
$this->hasTag = new HasTagViaConsole();
3331

34-
delete_file($this->repository);
35-
create_directory($this->repository);
32+
Filesystem\delete_file($this->repository);
33+
Filesystem\create_directory($this->repository);
3634

37-
execute('git', ['init'], $this->repository);
35+
Shell\execute('git', ['init'], $this->repository);
3836

39-
execute('git', ['config', 'user.email', '[email protected]'], $this->repository);
40-
execute('git', ['config', 'user.name', 'Just Me'], $this->repository);
37+
Shell\execute('git', ['config', 'user.email', '[email protected]'], $this->repository);
38+
Shell\execute('git', ['config', 'user.name', 'Just Me'], $this->repository);
4139

4240
array_map(fn (string $tag) => $this->createTag($tag), [
4341
'1.0.0',
@@ -47,29 +45,35 @@ protected function setUp(): void
4745

4846
private function createTag(string $tag): void
4947
{
50-
execute('git', ['commit', '--allow-empty', '-m', 'a commit for version ' . $tag], $this->repository);
51-
execute('git', ['tag', '-a', $tag, '-m', 'version ' . $tag], $this->repository);
48+
Shell\execute('git', ['commit', '--allow-empty', '-m', 'a commit for version ' . $tag], $this->repository);
49+
Shell\execute('git', ['tag', '-a', $tag, '-m', 'version ' . $tag], $this->repository);
5250
}
5351

54-
/** @param non-empty-string $repository */
52+
/**
53+
* @param non-empty-string $repository
54+
* @param non-empty-string $tag
55+
*/
5556
private function assertGitTagExists(string $repository, string $tag): void
5657
{
5758
self::assertTrue(($this->hasTag)($repository, $tag), sprintf('Failed asserting git tag "%s" exists.', $tag));
5859
}
5960

60-
/** @param non-empty-string $repository */
61+
/**
62+
* @param non-empty-string $repository
63+
* @param non-empty-string $tag
64+
*/
6165
private function assertGitTagMissing(string $repository, string $tag): void
6266
{
6367
self::assertFalse(($this->hasTag)($repository, $tag), sprintf('Failed asserting git tag "%s" is missing.', $tag));
6468
}
6569

6670
public function testHasTag(): void
6771
{
68-
self::assertGitTagExists($this->repository, '1.0.0');
72+
$this->assertGitTagExists($this->repository, '1.0.0');
6973
}
7074

7175
public function testHasTagMissing(): void
7276
{
73-
self::assertGitTagMissing($this->repository, '10.0.0');
77+
$this->assertGitTagMissing($this->repository, '10.0.0');
7478
}
7579
}

0 commit comments

Comments
 (0)