phpstan-baseline-analysis
phpstan-baseline-analysis copied to clipboard
Use baseline mtime instead of current time
Added flag --mtime to use the baseline file modification timestamp as the date instead of "now", because it makes much more sense when you need to generate multiple reports from the same repository or want to track actual changes to the baseline
Which problem should this PR solve? Would https://github.com/staabm/phpstan-baseline-analysis/pull/91 also work for you?
The problem is that all JSON files got the same (current) date, so the graph is not very useful
[
{
"phpstan-baseline.neon": {
"Date": "Fri, 29 Nov 2024 17:01:16 +0000",
"Overall-Errors": 4062,
"Classes-Cognitive-Complexity": 0,
"Deprecations": 44,
"Invalid-Phpdocs": 37,
"Unknown-Types": 3,
"Anonymous-Variables": 0,
"Native-Property-Type-Coverage": 0,
"Native-Param-Type-Coverage": 0,
"Native-Return-Type-Coverage": 0,
"Unused-Symbols": 0
}
}
]
versus
with the correct dates..
The ksort was also needed to make sure the data is displayed correctly.. Otherwise data points were rendered in some very weird random order, which makes no sense for a graph that should have time as one axis
At least I guess that the actual modification time of the baseline is more correct than "now" in most cases? It could maybe be optional though...
did you check whether the fix from https://github.com/staabm/phpstan-baseline-analysis/pull/91 would work for you? (without the modifications of this PRs here)