Mago 1.0.0-beta.4
Welcome to the 1.0.0-beta.4
release of Mago! This update is packed with significant formatter enhancements that make your code look even better, plus a nice quality-of-life improvement for the linter and some documentation polish. ✨
💅 Formatter
This release includes a major tune-up for the code formatter, focusing on stability and smarter formatting for complex expressions. Your code should now be more readable and consistently formatted across the board.
Key improvements include:
- Smarter Method Chains: The formatter is now less likely to break method chains with short names (e.g.,
->of()
,->to()
), resulting in more compact and readable fluent interfaces. (Closes #334) - Safer Ternaries: Parenthesization for nested conditional (ternary/elvis) expressions has been made more accurate. This helps prevent bugs related to PHP's tricky operator associativity rules. (Closes #336)
- Better
match
Expressions: Formatting formatch
expressions, especially those with multiple arms, has been improved.
✅ Linter
- New Rule:
no-nested-ternary
: A new rule has been added to detect and warn against nested ternary expressions($a ? $b : ($c ? $d : $e))
. This encourages writing more readable code and helps prevent bugs related to PHP's confusing operator associativity rules. - Easier Configuration for
assertion-style
: You can now configure theassertion-style
rule in yourmago.toml
file using the more intuitive values"self"
or"$this"
.
📝 Documentation
- The documentation has received a polish pass to improve casing, readability, and overall presentation. A big thank you to @innocenzi for the contribution (#337)!
Full Changelog: 1.0.0-beta.3...1.0.0-beta.4