From 83063272e58023f17401c28078d624c0b81778b3 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Thu, 1 Jun 2023 14:32:25 +0200 Subject: [PATCH 1/3] Add package versions to Shepherd payload --- src/Psalm/Plugin/Shepherd.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Psalm/Plugin/Shepherd.php b/src/Psalm/Plugin/Shepherd.php index 49dc628e9b3..87a62192815 100644 --- a/src/Psalm/Plugin/Shepherd.php +++ b/src/Psalm/Plugin/Shepherd.php @@ -5,6 +5,7 @@ use BadMethodCallException; use Psalm\Config; use Psalm\Internal\Analyzer\IssueData; +use Psalm\Internal\VersionUtils; use Psalm\Plugin\EventHandler\AfterAnalysisInterface; use Psalm\Plugin\EventHandler\Event\AfterAnalysisEvent; @@ -134,6 +135,10 @@ private static function collectPayloadToSend(AfterAnalysisEvent $event): ?array 'issues' => $normalized_data, 'coverage' => $codebase->analyzer->getTotalTypeCoverage($codebase), 'level' => Config::getInstance()->level, + 'versions' => [ + 'psalm' => VersionUtils::getPsalmVersion(), + 'parser' => VersionUtils::getPhpParserVersion(), + ], ]; } From f114858be9805b6007d499038cae64ed0429c5cf Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Thu, 1 Jun 2023 14:37:05 +0200 Subject: [PATCH 2/3] Update array shape --- src/Psalm/Plugin/Shepherd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Plugin/Shepherd.php b/src/Psalm/Plugin/Shepherd.php index 87a62192815..2ee9969ec23 100644 --- a/src/Psalm/Plugin/Shepherd.php +++ b/src/Psalm/Plugin/Shepherd.php @@ -96,7 +96,7 @@ private static function buildShepherdUrlFromHost(string $host): string } /** - * @return array{build: array, git: array, issues: array, coverage: list, level: int<1,8>}|null + * @return array{build: array, git: array, issues: array, coverage: list, level: int<1,8>, versions: array}|null */ private static function collectPayloadToSend(AfterAnalysisEvent $event): ?array { From d3a6da74181ce511923cdc35669c9a8210b710e0 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Thu, 1 Jun 2023 16:38:29 +0200 Subject: [PATCH 3/3] Fix coding style issue --- src/Psalm/Plugin/Shepherd.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Plugin/Shepherd.php b/src/Psalm/Plugin/Shepherd.php index 2ee9969ec23..096a17bb9cf 100644 --- a/src/Psalm/Plugin/Shepherd.php +++ b/src/Psalm/Plugin/Shepherd.php @@ -96,7 +96,14 @@ private static function buildShepherdUrlFromHost(string $host): string } /** - * @return array{build: array, git: array, issues: array, coverage: list, level: int<1,8>, versions: array}|null + * @return array{ + * build: array, + * git: array, + * issues: array, + * coverage: list, + * level: int<1, 8>, + * versions: array + * }|null */ private static function collectPayloadToSend(AfterAnalysisEvent $event): ?array {