github carthage-software/mago 1.15.3
Mago 1.15.3

9 hours ago

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_break decisions 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 used source_text.contains("?>") to detect inline PHP templates. When remove_trailing_close_tag removed 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 \r not 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. Fixed skip_newline, split_lines, replace_end_of_line, and print_comment to handle bare \r as a line terminator. Also fixed line_starts in 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 accepted OpenSSLCertificate|false instead of the correct OpenSSLCertificate|string parameter type (#1463)

Composer

  • Fixed CPU spin-lock in Composer wrapper: The PHP wrapper process polled proc_get_status in a tight loop with no sleep, causing 100% CPU usage on one core during --watch mode. 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

Don't miss a new mago release

NewReleases is sending notifications on new releases.