Skip to content

Commit 8171e98

Browse files
committed
Fix types / arrray shpes
1 parent 00c828b commit 8171e98

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/Api/Issue/GithubIssueApi.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function lastCommentWasMadeByBot(Repository $repository, int $number): bo
4949
return $this->botUsername === ($lastComment['user']['login'] ?? null);
5050
}
5151

52-
/**
53-
* @return array<string, mixed>
54-
*/
5552
public function show(Repository $repository, int $issueNumber): array
5653
{
5754
return $this->issueApi->show($repository->getVendor(), $repository->getName(), $issueNumber);
@@ -83,9 +80,6 @@ public function commentOnIssue(Repository $repository, int $issueNumber, string
8380
);
8481
}
8582

86-
/**
87-
* @return array<int, array<string, mixed>>
88-
*/
8983
public function findStaleIssues(Repository $repository, \DateTimeImmutable $noUpdateAfter): iterable
9084
{
9185
return $this->resultPager->fetchAllLazy($this->searchApi, 'issues', [

src/Api/Milestone/GithubMilestoneApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class GithubMilestoneApi implements MilestoneApi
1313
{
1414
/**
15-
* @var string[][]
15+
* @var array<string, array<int, array{title: string, number: int}>>
1616
*/
1717
private array $cache = [];
1818

@@ -23,7 +23,7 @@ public function __construct(
2323
}
2424

2525
/**
26-
* @return array<array<string, mixed>>
26+
* @return array<int, array{title: string, number: int}>
2727
*/
2828
private function getMilestones(Repository $repository): array
2929
{

src/Command/PingStaleIssuesCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*/
2323
class PingStaleIssuesCommand extends Command
2424
{
25-
public const MESSAGE_TWO_AFTER = '+2weeks';
26-
public const MESSAGE_THREE_AND_CLOSE_AFTER = '+2weeks';
25+
public const string MESSAGE_TWO_AFTER = '+2weeks';
26+
public const string MESSAGE_THREE_AND_CLOSE_AFTER = '+2weeks';
2727

2828
protected static $defaultName = 'app:issue:ping-stale';
2929

@@ -69,6 +69,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6969
}
7070

7171
foreach ($issues as $issue) {
72+
/**
73+
* @var array{number: int, name: string, labels: array<int, array{name: string}>} $issue
74+
*/
7275
$comment = $this->commentGenerator->getComment($this->extractType($issue));
7376
$this->issueApi->commentOnIssue($repository, $issue['number'], $comment);
7477
$this->labelApi->addIssueLabel($issue['number'], 'Stalled', $repository);
@@ -84,7 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8487
* Extract type from issue array. Make sure we prioritize labels if there are
8588
* more than one type defined.
8689
*
87-
* @param array<string, mixed> $issue
90+
* @param array{number: int, name: string, labels: array<int, array{name: string}>} $issue
8891
*/
8992
private function extractType(array $issue): string
9093
{

src/Subscriber/RewriteUnwantedPhrasesSubscriber.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public function onPullRequest(GitHubEvent $event): void
6060
}
6161

6262
/**
63-
* @param int &$count (optional)
63+
* @param int<0, max>|null &$count
64+
*
65+
* @param-out int $count
6466
*/
6567
private function replaceUnwantedPhrases(string $text, &$count): string
6668
{

0 commit comments

Comments
 (0)