1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

adding php & extension version info to baseline file to track changes in execution environment when baselines are added to vcs (#1804)

This commit is contained in:
SignpostMarv 2019-06-17 21:43:54 +01:00 committed by Matthew Brown
parent 5ab5ec261c
commit de881767a5

View File

@ -207,6 +207,22 @@ class ErrorBaseline
$filesNode = $baselineDoc->createElement('files');
$filesNode->setAttribute('psalm-version', PSALM_VERSION);
$extensions = array_merge(get_loaded_extensions(), get_loaded_extensions(true));
usort($extensions, 'strnatcasecmp');
$filesNode->setAttribute('php-version', implode('; ', array_merge(
[
('php:' . phpversion()),
],
array_map(
function (string $extension) : string {
return $extension . ':' . phpversion($extension);
},
$extensions
)
)));
foreach ($groupedIssues as $file => $issueTypes) {
$fileNode = $baselineDoc->createElement('file');