Skip to content

Analyzer Tracking Issue #247

@azjezz

Description

@azjezz

This issue tracks the ongoing development of the new mago analyzer, introduced in PR #230

The initial version has been merged in an experimental state to unblock further development and allow for incremental releases. This issue outlines the roadmap toward a stable, production-ready analyzer.

  • Core Tasks for Stabilization:

    • Remove Panics: Systematically replace all instances of unwrap() and unreachable!() with proper error reporting.
    • Centralize Error Reporting: Refactor error reporting logic so that each unique error is handled by a single, dedicated function for consistency.
  • Performance Optimizations 🚀:

    • Reduce clone() operations: Profile and minimize clone() calls within mago-codex and mago-analyzer to improve memory usage and speed.
    • General Performance Tuning: A dedicated round of optimizations will be undertaken before a stable release.
  • Feature Implementation:

    • Implement unsafe/safe/limbo System (Must-have):

      • @unsafe: For functions/types that can only be used in other @unsafe contexts.
      • @safe: Guarantees a function/type can only use other @safe symbols.
    • Implement Effect System (Nice-to-have)

      • Introduce @effects X, Y, Z to supersede @pure, @mutation-free, etc.
      • @throws Exception will become @effect Throws<Exception>.
      • @no-effects will signify a pure function.
  • Future Ideas 💡:

    • Typed Linter Integration: Explore passing type information to a linter to enable typed linting rules, similar to typescript-eslint.
  • Quality Assurance & Verification:

    • Cross-Project Bug Verification: Review the last 100 bug reports for vimeo/psalm and phpstan/phpstan to ensure mago avoids similar pitfalls.

    • CI: Real-World Project Testing: Add the following projects to the CI pipeline to test the analyzer against real-world codebases.

      • azjezz/psl
      • veewee/xml
      • Roave/BetterReflection
      • veewee/reflecta
      • psalm/endtoend-test-collections
      • psalm/endtoend-test-phpunit

Metadata

Metadata

Assignees

Labels

Priority: CriticalThis should be dealt with ASAP. Not fixing would be a serious error.Status: In ProgressThis issue is being worked on and has someone assigned.Subject: AnalyzerAn issue or PR related to the static analyzer/type checker.Type: MetaGeneral discussion or broader project/organizational tasks.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions