Mago v1.0.0-alpha.12
is here, with a major focus on giving you powerful new ways to configure the analyzer! This release introduces issue categories and project-wide issue ignoring, making it easier than ever to tailor the analysis to your needs and gradually adopt Mago on any codebase. We've also completely overhauled the mago init
experience to get you started faster.
⚙️ Advanced Analyzer Configuration
This release introduces two powerful new ways to control the issues Mago reports.
New: Issue Categories
All analyzer diagnostics have been grouped into logical categories. This allows you to disable entire groups of checks in your mago.toml
to reduce noise, which is perfect for gradual adoption.
All categories are enabled by default. To disable one, for example:
[analyzer]
# Suppress all issues related to null values.
nullable_issues = false
The full list of available categories
ambiguity_issues
argument_issues
array_issues
deprecation_issues
existence_issues
falsable_issues
generator_issues
impossibility_issues
iterator_issues
method_issues
mixed_issues
nullable_issues
operand_issues
property_issues
redundancy_issues
reference_issues
return_issues
template_issues
unreachable_issues
New: Ignore Specific Issues
You can now create a project-wide baseline of ignored issues using the analyze.ignore
configuration option. This is a great alternative to cluttering your code with numerous @mago-expect
pragmas.
[analyzer]
ignore = ["mixed-argument", "unhandled-thrown-type"]
✨ Improved User Experience
Self-Documenting mago.toml
The mago init
command now generates a comprehensive configuration file with all available analyzer settings commented out and explained. This makes every option easily discoverable without needing to consult external documentation.
Standardized Configuration
The keys in mago.toml
have been standardized to [formatter]
, [linter]
, and [analyzer]
for consistency. To ensure backward compatibility, aliases for the old keys ([format]
, [lint]
) and common variations ([analyser]
, [analyze]
, [analyse]
) have been added, so existing configuration files will continue to work without modification.
🛠️ Fixes & Improvements
- Docblock Parser: The parser now "correctly" handles types terminated with a . (e.g.,
@return string. A description
), improving compatibility with WordPress-style docblocks. - Formatter: Fixed a bug where comments and whitespace around PHP closing tags (
?>
) could be formatted incorrectly, leading to non-idempotent results. (#299)
Full Changelog: 1.0.0-alpha.11...1.0.0-alpha.12