Skip to content

Instantly share code, notes, and snippets.

@alexander-schranz
Created March 11, 2025 08:14
Show Gist options
  • Save alexander-schranz/1bc016ee637bb8995d67120b14091c16 to your computer and use it in GitHub Desktop.
Save alexander-schranz/1bc016ee637bb8995d67120b14091c16 to your computer and use it in GitHub Desktop.
PHPStan Baseline Timeline
php -r '(function(string $baselineFile, string $branch) {
echo "date,count\\n";
foreach (explode("\\n", `git log {$branch} --pretty="format:%H;%cI" --date-order --reverse {$baselineFile}`) as $line) {
[$hash, $date] = explode(";", $line);
preg_match_all("`^\\s+count:\\s+(\\d+)`m", `git show $hash:{$baselineFile}`, $matches);
echo $date, ",", array_sum(array_map("intval", $matches[1])), "\\n";
}
})("phpstan-baseline.neon", "origin/3.0");' # branch name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment