github carthage-software/mago 0.9.0
Mago 0.9.0

latest releases: 1.0.0-beta.12, 1.0.0-beta.11, 1.0.0-beta.10...
7 months ago

Mago 0.9.0 introduces deeper undefined reference checks, a brand-new mago find command for locating symbol references, and a new rule to catch unnecessary hash comments (#️⃣).


🔥 Major Changes

1️⃣ Expanded Undefined Member Checks & Improved Severity Handling

Mago now detects more cases of undefined methods, functions, constants, and enum cases, preventing runtime errors before they happen.

New Checks Added:

✅ Calling an undefined, non-static, or abstract static method is now flagged
✅ Creating a closure for an undefined function is now reported
Class-like constants & enum cases that are undefined are now detected
Static method calls on traits (deprecated in PHP 8.2+) now trigger warnings
Fix: Severity levels now correctly respect user configurations

🔎 Why This Matters: These changes ensure Mago catches more real-world issues in PHP codebases, helping developers avoid hard-to-debug runtime errors.


2️⃣ New CLI Command: mago find 🔍

A powerful new command has landed! mago find [query] lets you search for symbol references (e.g., functions, classes, traits, enum cases, and more) across your PHP project instantly.

How It Works

  • Find where a symbol is used: mago find SomeClass
  • Search for function references: mago find some_function
  • Locate all trait usages: mago find SomeTrait
  • Works in user-defined & external sources

🎯 Built for speed & accuracy, this feature is ideal for navigating large codebases, understanding dependencies, and future LSP integrations.

📸 Example screenshots:

Screenshot 2025-02-05 at 13 33 10 Screenshot 2025-02-05 at 13 34 36

3️⃣ Overhauled Linter Rule System & Micro-Optimizations

Big internal refactoring:

✅ Improved performance in various crates
✅ The linter rule system is now more efficient & extendable
✅ These changes pave the way for future improvements


Pull Requests

  • refactor: overhaul linter rule system and micro-optimize crates by @azjezz in #66
  • feat(lexer/linter): add support for #️⃣ hash emoji & corresponding linter rule by @azjezz in #67
  • revert: remove emoji support in lexer and update NoHashEmojiRule by @azjezz in #68
  • feat(linter): expand checks for undefined members & fix level handling by @azjezz in #70
  • feat: introduce reference crate, and find cli command by @azjezz in #69

Full Changelog: 0.8.1...0.9.0

Don't miss a new mago release

NewReleases is sending notifications on new releases.