Mago 1.0.0-beta.16
This release introduces a major upgrade to the baseline feature, making it a powerful tool for CI/CD workflows. We've also added significant quality-of-life improvements to issue suppression pragmas and fixed a key regression in the analyzer's closure type inference.
🛡️ All-New Baseline Verification for CI
The baseline feature has been enhanced with new verification capabilities, designed to keep your baseline file perfectly in sync with your codebase.
- New
--verify-baseline
Flag: You can now use this flag in your CI pipeline to fail the build if the baseline is out of date. It checks for both new issues not in the baseline and fixed issues that are still listed, ensuring your baseline is always an accurate representation of your project's acknowledged issues. - New
--fail-on-out-of-sync-baseline
Flag: A stricter option that will fail the build if the baseline contains fixed issues, even if no new issues are reported. - Deterministic Generation: Baseline files are now generated with a stable, alphabetical order for both files and the issues within them. This completely eliminates noisy, meaningless diffs in pull requests when the baseline is updated.
✨ Usability Improvements
- Pragma Category Aliases: The pragma system is now more forgiving. You can use common aliases for categories, such as
linter
(forlint
) andanalyzer
oranalyser
(foranalysis
). - Improved Pragma Detection: Pragmas like
@mago-expect
are now correctly detected when they are on their own line inside a multi-line PHPDoc block, making suppression behavior more intuitive.
🐞 Fixes & Improvements
- Analyzer: Fixed a significant regression where the return type of closures that did not explicitly
return
was being inferred incorrectly. The analyzer now correctly infersvoid
ornever
, eliminating a major source of false positive errors. (#455) - Docblock Parser: Fixed a panic that could occur when parsing docblocks containing certain multi-byte UTF-8 characters. (#456)
- Linter: The
unused-parameter
rule has been relaxed and will no longer report parameters that are marked as unused ( prefixed with$_
), reducing noise.
Closed Issues
Full Changelog: 1.0.0-beta.15...1.0.0-beta.16