Mago 1.15.3
Mago 1.15.3 is a patch release that fixes formatter idempotency issues with trailing closing tags and non-standard line endings, adds a comment placement infrastructure for stable binary expression formatting, fixes incorrect OpenSSL function signatures, and resolves a CPU spin-lock in the Composer wrapper.
✨ Features
Formatter
- Comment placement infrastructure for binary expressions: Added a structural comment placement phase that pre-assigns comments to AST nodes via DFS before formatting. This stabilizes
should_breakdecisions in binary expressions and keeps comments inside parenthesized subexpressions, fixing formatting oscillation between passes (#817, #1456)
🐛 Bug Fixes
Formatter
- Fixed idempotency when trailing
?>is removed: The opening tag formatting decision usedsource_text.contains("?>")to detect inline PHP templates. Whenremove_trailing_close_tagremoved a trailing?>on the first pass, the second pass saw no?>and changed the formatting. Replaced with an AST walker that counts closing tags at any depth, excluding the trailing one that gets removed (#1350, #1457) - Fixed bare
\rnot recognized as line terminator: Files with\r\r\n, bare\r(classic Mac OS), or other non-standard line endings caused the formatter to merge lines and crash on multi-line block comments. Fixedskip_newline,split_lines,replace_end_of_line, andprint_commentto handle bare\ras a line terminator. Also fixedline_startsin the database crate which only scanned for\n, causing incorrect line numbering for bare-CR files (#1460, #1462)
Prelude
- Fixed OpenSSL function signatures: Several
openssl_x509_*functions incorrectly acceptedOpenSSLCertificate|falseinstead of the correctOpenSSLCertificate|stringparameter type (#1463)
Composer
- Fixed CPU spin-lock in Composer wrapper: The PHP wrapper process polled
proc_get_statusin a tight loop with no sleep, causing 100% CPU usage on one core during--watchmode. Added a 10ms sleep interval and fixed signal-based exit code propagation (#1454, #1455)
🏗️ Internal
- Migrated test corpus to php-standard-library and added api-platform (#1458)
🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
Full Changelog: 1.15.2...1.15.3