Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Shepherd payload by information about package versions #9856

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Psalm/Plugin/Shepherd.php
Expand Up @@ -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;

Expand Down Expand Up @@ -95,7 +96,14 @@ private static function buildShepherdUrlFromHost(string $host): string
}

/**
* @return array{build: array, git: array, issues: array, coverage: list<int>, level: int<1,8>}|null
* @return array{
* build: array,
* git: array,
* issues: array,
* coverage: list<int>,
* level: int<1, 8>,
* versions: array<string, string>
* }|null
*/
private static function collectPayloadToSend(AfterAnalysisEvent $event): ?array
{
Expand Down Expand Up @@ -134,6 +142,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(),
],
];
}

Expand Down