github carthage-software/mago 1.0.0-rc.11
Mago 1.0.0-rc.11

one day ago

This release focuses on reducing false positives, improving type system accuracy, performance optimizations, and introducing new linter rules.

New Features

Linter

  • New property-name rule (#703)
    Added a new linter rule to enforce consistent property naming conventions across your codebase.

  • New use-specific-assertions rule
    Introduced a new rule that encourages using specific assertion methods (e.g., assertTrue, assertNull) instead of generic assertEquals/assertSame with literal values for better clarity and intent.

Analyzer

  • Type narrowing for symbol existence checks
    The analyzer now properly narrows types based on symbol and member existence checks like function_exists(), method_exists(), property_exists(), and defined(). This eliminates false positives when conditionally using symbols after checking their existence.

Bug Fixes

Analyzer

  • Fixed false positives for class-string comparisons and static variable initialization
    Resolved issues where the analyzer incorrectly flagged valid code involving class-string type comparisons and static variable initialization patterns.

  • Fixed false positive for count() comparison on non-empty-list
    The analyzer no longer incorrectly reports issues when comparing the count of a non-empty-list with integer values.

  • Fixed list type preservation when narrowing with is_array()
    Using is_array() on a union type containing a list no longer incorrectly loses the list type information.

  • Fixed interface method resolution for __callStatic
    The analyzer now only reports interface implementation issues when resolving actual methods, not when resolving magic __callStatic calls.

  • Fixed invalid array access assignment value checking
    Improved detection of invalid values being assigned through array access expressions.

Reconciler

  • Fixed list type narrowing preserving assertion element types
    Type narrowing on list types now correctly preserves the element type assertions, preventing false positives in generic list operations.

Docblock

  • Fixed @method tag with static return type
    The docblock parser now correctly handles @method tags that specify static as their return type.

Linter

  • Made strict-assertions rule less strict
    The strict-assertions rule has been adjusted to reduce noise while still catching problematic assertion patterns.

WASM

  • Matched analyzer default settings
    The WASM build now uses the same default analyzer settings as the native build for consistent behavior.

Reporting

  • Fixed duplicate issue collection
    Removed unnecessary duplicate checking when collecting issues, improving performance and correctness.

Performance Improvements

  • Optimized type combiner
    Significant performance improvements to the type combination logic, reducing analysis time for codebases with complex type operations.

  • Lowered analysis thresholds
    Adjusted internal thresholds for formula complexity and algebra operations to improve analysis speed on large codebases without sacrificing accuracy.

  • Early return optimization for pragma collection
    Added early return when no pragmas are present, avoiding unnecessary processing.

Build Improvements

  • Profile-Guided Optimization (PGO) for Tier 1 targets
    Release binaries for macOS and Windows are now built with PGO, resulting in 5-15% performance improvements.

Full Changelog: 1.0.0-rc.10...1.0.0-rc.11

Don't miss a new mago release

NewReleases is sending notifications on new releases.