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

one day ago

Mago 1.0.0-rc.12

This release continues our focus on reducing false positives, improving generic type handling, and enhancing PHP 8.4+ property hooks support.

New Features

Analyzer

  • Uninitialized Property Detection: Added detection for uninitialized properties and missing constructors, helping catch potential runtime errors before they occur.

Formatter

  • Staged Formatting Support: Added fmt --staged command for formatting only staged files, along with a pre-commit hooks guide for seamless CI integration.

Bug Fixes

Analyzer

  • Generic Parameter Literal Equality: Fixed false "impossible condition" warnings when comparing generic parameters to literal values (=== '', === 0, === 1.5, === true, === false) after type narrowing in OR conditions.
  • Property Hook Inheritance: Fixed false positive for unimplemented-abstract-property-hook when a concrete class inherits the hook implementation from a parent class.
  • is_callable() Narrowing: Added support for is_callable() type narrowing on array callables with class-string elements (e.g., array{class-string<Foo>, 'method'}).
  • isset() on Open Array Shapes: Fixed false positives when using isset() checks on open array shapes with mixed values.
  • Dynamic Property Access on stdClass: Allowed dynamic property access on stdClass without triggering errors.
  • Method Override Compatibility: Added verification of method compatibility when overriding non-abstract methods from parent classes.
  • Generic Parameter Constraint Binding: Fixed issue where generic parameters were incorrectly bound when constraints were not satisfied.

Codex

  • Property Hook Types: Fixed population of property hook parameter and return types for proper type checking.
  • Deterministic Output: Ensured consistent ordering of parent classes and interfaces for deterministic analysis results.

Docblock

  • @method Tag Parsing: Fixed parsing of @method tags with leading whitespace.

Formatter

  • Heredoc/Nowdoc Comment Preservation: Fixed critical bug where comments before heredoc/nowdoc (e.g., /** @lang SQL */) were incorrectly moved after the opening identifier, resulting in invalid code.
  • Consistent Defaults: Made empty_line_after_opening_tag default behavior consistent across configurations.

New Contributors


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

Don't miss a new mago release

NewReleases is sending notifications on new releases.