github carthage-software/mago 1.27.0
Mago 1.27.0

4 hours ago

Mago 1.27.0

A feature release built around Mago\Available* attributes for version-gating PHP symbols, several formatter additions for attribute ordering and multi-trait use splits under PER-CS/PSR-12, a hierarchy-aware Class::method form for class-initializers, and a namespaced mode for no-fully-qualified-global-function that imports the parent namespace instead of the function. The rest is a batch of analyzer narrowings, a mago lint --only CLI fix, the long-standing PHP 8.4 inline new X()->method() formatter fix, and docs work (playground contrast, version-switch keeping you on the same page).

✨ Features

Codex

  • Mago\Available* attributes: version-gate symbols across codex, analyzer, prelude, and composer. (#1113, 7a59a92)

Analyzer

  • Class::method in class-initializers: scope an initializer to a class hierarchy via Foo::configure. (#1684, 6fb88c6)

Linter

  • namespaced option on no-fully-qualified-global-function: import the namespace, not the function. (#1804, af49248)
  • no-negated-ternary covers !==, !=, <>: rule now flags negated comparisons beyond !=. (#1825, 629cbe6)
  • no-assign-in-condition while opt-out: optionally ignore while statements. (#1819, 47e3118)

Formatter

  • attributes-order + separate-attributes options: control attribute ordering and grouping. (#1820, 0e835ef0)
  • Multi-trait use split: one trait per use statement under PER-CS / PSR-12. (#1807, e06da32)

Reporting

  • Structured baseline diff: --verify-baseline --reporting-format json emits a structured diff. (#1812, e5d26d6)

Testing

  • Standalone integration test runner: independent harness for cross-crate integration tests. (#1805, 56e6414)

🐛 Bug Fixes

Analyzer

  • array_filter / array_all callback narrowing: lift callback assertions onto array values from mixed. (#1801, 60e34a9)
  • Property narrowings across opaque calls: preserved when the call cannot see the property. (#1811, c1bce5b)
  • Relational comparisons on arrays: warns when one operand may be an array. (#1815, f843108)
  • array_all unwrap: replaced with let-binding to avoid panicking on unexpected shapes. (ab1792c)

Codex

  • Generic index parameters in TIndexAccess: now expanded so T[K] resolves through bounds. (#1810, 03791963)

Linter

  • no-is-null autofix: clean null === $x / null !== $x output across negation, parens, and double-negation. (#1821, 45f7972)

Formatter

  • PHP 8.4 inline new X()->method(): emitted when both paren options are off. (#1808, a70b2ef)
  • Tab-width-aware line wrapping: use-tabs = true now counts tab columns against print-width. (#1806, a91604a)

CLI

  • --only stops swallowing paths: mago lint -o code path.php now lints path.php instead of treating it as another rule. (#1814, 81cae5c)

Orchestrator

  • ParallelPipeline Debug: includes php_version for clearer diagnostics. (1bfce02)

Nix flake

  • Correct Rust version: flake pins its own toolchain rather than inheriting global settings. (#1822, 61c3a82)

📖 Documentation

  • Playground contrast: fixed text-selection visibility, link styling, and sidebar contrast. (#1795, a27851a)
  • Version switch keeps the page: per-version paths recorded so the dropdown links to the same page across versions. (#1803, ef0b0e0)
  • Docker recipe GitLab CI: documents the entrypoint override for GitLab pipelines. (#1824, 85164ee)

🙏 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.26.0...1.27.0

Don't miss a new mago release

NewReleases is sending notifications on new releases.