✨ New Features
- Auto-fix for Strict Behavior Rule 🛠️: The
strictness/require-strict-behavior
rule now supports auto-fixing, making it even easier to enforce strict types in your projects! (closes #170) - Literal Named Arguments Rule ✍️: Introducing the new
best-practices/literal-named-argument
rule. It encourages using named arguments for literals (booleans, numbers, nulls) to drastically improve code readability at the call site. (closes #195) - PHP 8.5 Syntax Support 🚀: Mago's parser now understands several new features introduced in PHP 8.5, including the
NoDiscard
attribute, using closure creation in constant expressions, thevoid
cast, and asymmetric visibility on static properties. - Enhanced Type Syntax 📝: We've added support for optional shape keys (e.g.,
array{string}
), allowing for more precise type definitions. Also includes Display trait implementations for easier AST debugging. php-version
Crate Updates 🗓️: The php-version utility crate now includes constants for PHP8.5
, along with our dynamicLATEST
andNEXT
PHP version constants to help you target specific PHP versions. (Friendly reminder:LATEST
andNEXT
values will change over time!)
🛠️ Fixes & Enhancements
- Formatter - Arrow Function Improvements:
- Aligned with PHP's behavior by dropping formatter support for variadic named arguments and fixed formatting for some low-precedence operators.
- Formatter - WASM Support 🕸️: The
mago-formatter
can now be compiled to the wasm32-unknown-unknown target! (Thanks @dsherret, #193) - Formatter - Docs: Corrected settings documentation for better clarity. (closes #185)
- Linter - Messaging: Fixed some minor spelling and capitalization issues in linter messages for a more polished experience. (Thanks @DannyJJK , #196)
- Ast (Syntax): Addressed an issue with checks for trailing tokens in sequences, improving parsing robustness.
- Docblock Parser: Fixed a bug where parts of docblock descriptions were being unintentionally trimmed.
🧹 Other Notable Changes
- Build: The Minimum Supported Rust Version (MSRV) has been updated to 1.87.0.
- Documentation: Added instructions for configuring Mago with the Helix editor. (Thanks @AsymetricData, #194)
- Various internal improvements, including Clippy fixes, syntax updates, and refactors for ongoing stability and performance.
New Contributors
- @dsherret made their first contribution in #193
- @AsymetricData made their first contribution in #194
- @DannyJJK made their first contribution in #196
Full Changelog: 0.23.0...0.24.0