Mago

Carthage Software · CarthageSoftware.Mago

Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.

Mago is a comprehensive toolchain for PHP that helps developers write better code. Inspired by the Rust ecosystem, Mago brings speed, reliability, and an exceptional developer experience to PHP projects of all sizes.

winget install --id CarthageSoftware.Mago --exact --source winget

Latest 1.30.0

Release Notes

Mago 1.30.0 A release focused on generics and robustness: intersection types of generic parameters are now computed, generic reflection (ReflectionClass) threads T into method-return inference, and a new fuzzing + Miri CI hardened the lexer and parsers against crashes, leaks, and quadratic blowups on malformed input. Also: vendor type patches, an object&callable type, and the usual analyzer, codex, formatter, linter, and CLI fixes. ✨ Features Analyzer

  • Generic reflection: ReflectionClass/ReflectionMethod thread T into getName()/invoke() return types. (c44dc8f)
  • object&callable type: invokable classes are accepted via has-method<__invoke>. (#1902, 7efac3c) Codex
  • Vendor type patches: a patches source overrides third-party types without editing vendor code. (#1873, dcfd38b) Database
  • Explicit extensionless files: files named without an extension are loaded when listed explicitly. (#1916, 639f481) πŸ› Bug Fixes Analyzer
  • Generic intersections: A&B of unions/iterables computed, e.g. (int|bool)&(int|float) β†’ int. (#1945, 353ed77, 7dd3d61)
  • do/while null-narrowing: the loop condition now narrows the body on re-entry. (#1947, db10237)
  • Undocumented __call return: inferred from __call's declared return instead of mixed. (131537a) Codex
  • public-properties-of: resolves inherited props, @type aliases, and generic-parameter selectors. (#1928, #1929, ce5eea6)
  • Transitive @mixin: methods resolve across mixin chains. (#1915, e6d9304)
  • Nested templates: params inside class-string and $this in @extends/@implements now resolve. (#1924, f2fff71, 5eda2e0)
  • Patched method signatures: abstract/concrete mismatches in method patches no longer flagged. (#1940, c370be3) Formatter
  • null last in unions: ordered last by default per PER CS 3. (#1835, 3e5d38c)
  • Comment before method chain: kept on its own line. (#1854, 1db1fa5)
  • Property-receiver chains: first method stays on the same line under same-line chain style. (#1193, 5ff2133) Linter
  • FQ refs in namespace-less files: fully-qualified global class/function/constant references are flagged. (#1846, 53626d0)
  • global/static rebinds: no false no-parameter-shadowing/no-dead-store. (#1910, #1911, 4ccc4f5) Syntax
  • Class-name keyword casing: resource/integer no longer collide with type keywords. (#1898, 899cbf3)
  • Identifier::last_segment: returns the last segment, not the first. (#1919, cadea52)
  • Interpolation perf & leaks: brace-interpolation scan is linear and string-aware; token-kind leak fixed. (#1914, 478aa81, a80e557) Type Syntax
  • Malformed-input hardening: type parser is depth-guarded; invalid float tokens like .1E are no longer emitted. (5179f3f, 6baf0b1) Twig Syntax
  • Malformed-input hardening: expression/statement parsing is depth-guarded and an arena leak is fixed. (f338622, 3972674) CLI
  • Versioned docs URL: the generated mago.toml links to a versioned, non-404 docs page. (#1939, b120e6b)
  • Baseline on scoped runs: no false out-of-sync warning on filtered runs. (#1904, fdffae9) Prelude
  • DateTime types: precise constant types and format() return type. (#1917, 70e6094) Database
  • Vendor watcher: stops adding vendor-path files as host files. (#1912, f1eaf73) πŸ—οΈ Internal Language Server
  • Experimental language server removed from the distribution, it is now available on the feat/language-server branch. (131b34c) CI / Tooling
  • Fuzzing & Miri: scheduled fuzz action and Miri job; fuzzers built for the gnu target so ASan links. (48a3cf1, b0dbd5f, 3b7f34b)
  • Stacked Borrows UB: word interner reads interned bytes via the raw entry pointer. (e9bd270)
  • Toolchain: workspace builds on Rust 1.96.0; routine nightly pins. (35e53c2, #1925)
  • MAGO_THREADS tests: no longer fail when the env var is set. (#1895, e2a9d31)
  • Dependencies: bump tar to 0.4.46. (#1920, b220deb) πŸ™ Thank You Contributors A huge thank you to everyone who contributed code to this release:
  • @dotdash: #1873, #1916, #1912, #1940, #1895
  • @gsteel: #1917 Issue Reporters Thank you to everyone who reported issues that shaped this release:
  • @Ocramius: #1945
  • @DanielBadura: #1947
  • @lyrixx: #1939
  • @ddanielou: #1928, #1929, #1902
  • @joshrai: #1924
  • @yoannblot: #1915
  • @AJenbo: #1919, #1914
  • @Brammm: #1913
  • @UweOhse: #1910, #1911
  • @adam-ja: #1904
  • @Plastonick: #1898
  • @simbig: #1854
  • @LocalHeroPro: #1846
  • @maximal: #1835
  • @MartkCz: #1193 Full Changelog: 1.29.0...1.30.0

Installer type: zip

Architecture Scope Download SHA256
x64 β€” Download 2DFD242DA7CFCE08275197119F206C636EE07C660D55A66A1B4804E56C820065

Details

Homepage
https://mago.carthage.software/1.30.0/en/
License
Apache-2.0
Publisher
Carthage Software
Support
https://github.com/carthage-software/mago/issues
Moniker
mago

Tags

astdevformattinglintphpsemantic-checksstatic-analysis

Older versions (5)

1.29.0
Architecture Scope Download SHA256
x64 β€” Download 4D5CD72917A8B367527C00BCE24CA032873C1C6ADDEE821C8C3D28FA4F71727A
1.28.0
Architecture Scope Download SHA256
x64 β€” Download A67E597ED0DECAFEB02EDDAE9EDA24AA9C59A3BCD69CCE49B73EE016626BC62C
1.27.1
Architecture Scope Download SHA256
x64 β€” Download 96bcaf3362907cb9b2e1879f3beb0234a4951ded9875872244b6b175d06ba699
1.27.0
Architecture Scope Download SHA256
x64 β€” Download 6428fb85baeb3442fbf55c6e6db9a803e9e91501e0df6006b0f5017d6509c1e3
1.26.0
Architecture Scope Download SHA256
x64 β€” Download f4b080030968d5b262357eda3bbe5ad5534c9f9a59a9697172c9e17b6472c3cc