fix: PHPStan level 3 - 12 return type errors fixed #123

Merged
jmiller merged 4 commits from dev into main 2026-05-26 03:19:41 +00:00
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -405,7 +405,7 @@ class GitHubAdapter implements GitPlatformAdapter
$page++;
}
return $all;
return array_values($all);
}
// ──────────────────────────────────────────────
+6 -6
View File
@@ -175,7 +175,7 @@ interface GitPlatformAdapter
/**
* List all branches in a repository.
*
* @return array<int, array<string, mixed>>
* @return array<mixed>
*/
public function listBranches(string $org, string $repo): array;
@@ -258,7 +258,7 @@ interface GitPlatformAdapter
* @param string $org Organization name
* @param string $repo Repository name
* @param array<string, mixed> $filters Filters (state, head, base, sort, direction)
* @return array<int, array<string, mixed>> Pull request list
* @return array<mixed> Pull request list
*/
public function listPullRequests(string $org, string $repo, array $filters = []): array;
@@ -305,7 +305,7 @@ interface GitPlatformAdapter
* @param string $org Organization name
* @param string $repo Repository name
* @param array<string, mixed> $filters Filters (state, labels, assignee, etc.)
* @return array<int, array<string, mixed>> Issue list
* @return array<mixed> Issue list
*/
public function listIssues(string $org, string $repo, array $filters = []): array;
@@ -357,7 +357,7 @@ interface GitPlatformAdapter
*
* @param string $org Organization name
* @param string $repo Repository name
* @return array<int, array{name: string, color: string, description: string}> Label list
* @return array<mixed> Label list
*/
public function listLabels(string $org, string $repo): array;
@@ -406,7 +406,7 @@ interface GitPlatformAdapter
*
* @param string $org Organization name
* @param string $repo Repository name
* @return array<int, array<string, mixed>> Protection rules
* @return array<mixed> Protection rules
*/
public function listBranchProtections(string $org, string $repo): array;
@@ -445,7 +445,7 @@ interface GitPlatformAdapter
* @param string $endpoint API endpoint path
* @param array<string, mixed> $params Query parameters
* @param int $perPage Items per page (platform default if 0)
* @return array<int, array<string, mixed>> All items across all pages
* @return array<mixed> All items across all pages
*/
public function paginateAll(string $endpoint, array $params = [], int $perPage = 100): array;
+1 -1
View File
@@ -468,7 +468,7 @@ class MokoGiteaAdapter implements GitPlatformAdapter
$page++;
}
return $all;
return array_values($all);
}
// ──────────────────────────────────────────────
+1 -1
View File
@@ -6,7 +6,7 @@
# PHPStan configuration for moko-platform projects
parameters:
level: 2
level: 3
paths:
- lib
- validate
+1 -1
View File
@@ -25,7 +25,7 @@ final class CheckFileIntegrity
private bool $verbose = false;
private bool $jsonOutput = false;
/** @var array{host: string, port: int, user: string, identity: string} */
/** @var array<string, mixed> */
private array $sftpConfig = [];
public function run(): int