github carthage-software/mago 0.0.8
Mago 0.0.8

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

Enhancements

  • Linter:

  • Introduce Laravel Plugin: Adds a new Laravel-specific plugin with an initial rule detecting Request::all() usage and suggesting Request::only(...) instead. Enable it with:

    [linter]
    plugins = ["laravel"]

    Future plans include adding more Laravel-specific rules.

  • Add Combine Consecutive Issets Rule: Transforms isset($a) && isset($b) into the more concise isset($a, $b).

  • Introduce Migration Plugin: Adds two migration rules:

    1. Convert strpos($a, $b) == 0 to str_starts_with($a, $b)
    2. Convert strpos($a, $b) != false to str_contains($a, $b)
      More PHP migration rules are planned for future releases.
  • Add Explicit Octal Notation Rule: Part of the migration plugin, converts old-style octal notation (e.g., 012) to the more explicit 0o12 for improved readability.

  • Add Readonly Class Promotion Rule: Transforms classes with only readonly properties into a readonly class, removing individual readonly modifiers for cleaner code.

  • Introduce Deprecation Plugin: Detects PHP deprecations with two initial rules:

    1. Convert implicitly nullable params string $a = null to explicitly nullable ?string $a = null (deprecated in PHP 8.4)
    2. Identify and suggest renaming class-like nodes named _ (deprecated in PHP 8.4)
  • Add PHP 8.0 and 8.2 Deprecation Rules:

    1. Detect optional parameters before required ones (deprecated in PHP 8.0)
    2. Identify return by reference from void functions/methods/closures (deprecated in PHP 8.2)

Fixes


Full Changelog: 0.0.7...0.0.8

Don't miss a new mago release

NewReleases is sending notifications on new releases.