github carthage-software/mago 0.24.0
Mago 0.24.0

latest releases: 1.0.0-beta.10, 1.0.0-beta.9, 1.0.0-beta.8...
3 months ago

✨ 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, the void 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 PHP 8.5, along with our dynamic LATEST and NEXT PHP version constants to help you target specific PHP versions. (Friendly reminder: LATEST and NEXT values will change over time!)

🛠️ Fixes & Enhancements

  • Formatter - Arrow Function Improvements:
    • Corrected support for "hugging" single-line arrow function expressions for a more compact style. (closes #199)
    • Improved how arrow functions used as the last argument are expanded, especially when they contain anonymous classes. (closes #198)
  • 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


Full Changelog: 0.23.0...0.24.0

Don't miss a new mago release

NewReleases is sending notifications on new releases.