From cbb4d73df58fd8579add9d4efe0804c20f4a153f Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 25 May 2026 22:42:50 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20PHPStan=20level=204=20=E2=86=92=205=20?= =?UTF-8?q?=E2=80=94=20fix=204=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bulk_sync: remove redundant array_values on already-list array - RepositorySynchronizer: fix metrics increment() — labels passed as 2nd param (value) instead of 3rd (labels), was a real bug PHPStan level 5: 0 errors. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- automation/bulk_sync.php | 2 +- lib/Enterprise/RepositorySynchronizer.php | 6 +++--- phpstan.neon | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/automation/bulk_sync.php b/automation/bulk_sync.php index 32f08bc..3e4e4e4 100755 --- a/automation/bulk_sync.php +++ b/automation/bulk_sync.php @@ -282,7 +282,7 @@ class BulkSync extends CliFramework } } - return array_values(array_merge($priority, $rest)); + return array_merge($priority, $rest); } /** diff --git a/lib/Enterprise/RepositorySynchronizer.php b/lib/Enterprise/RepositorySynchronizer.php index 8fdcf7f..195fe21 100644 --- a/lib/Enterprise/RepositorySynchronizer.php +++ b/lib/Enterprise/RepositorySynchronizer.php @@ -1508,16 +1508,16 @@ HCL; if ($updated) { $results['success']++; - $this->metrics->increment('repos_updated_total', ['status' => 'success']); + $this->metrics->increment('repos_updated_total', 1, ['status' => 'success']); $results['repositories'][$repoName] = 'updated'; } else { $results['skipped']++; - $this->metrics->increment('repos_updated_total', ['status' => 'skipped']); + $this->metrics->increment('repos_updated_total', 1, ['status' => 'skipped']); $results['repositories'][$repoName] = 'skipped'; } } catch (Exception $e) { $results['failed']++; - $this->metrics->increment('repos_updated_total', ['status' => 'failed']); + $this->metrics->increment('repos_updated_total', 1, ['status' => 'failed']); $results['repositories'][$repoName] = 'failed: ' . $e->getMessage(); } diff --git a/phpstan.neon b/phpstan.neon index 89aa56d..deb4e38 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ # PHPStan configuration for moko-platform projects parameters: - level: 4 + level: 5 paths: - lib - validate -- 2.52.0