Enhancements
-
Linter:
-
Introduce Laravel Plugin: Adds a new Laravel-specific plugin with an initial rule detecting
Request::all()
usage and suggestingRequest::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 conciseisset($a, $b)
. -
Introduce Migration Plugin: Adds two migration rules:
- Convert
strpos($a, $b) == 0
tostr_starts_with($a, $b)
- Convert
strpos($a, $b) != false
tostr_contains($a, $b)
More PHP migration rules are planned for future releases.
- Convert
-
Add Explicit Octal Notation Rule: Part of the migration plugin, converts old-style octal notation (e.g.,
012
) to the more explicit0o12
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:
- Convert implicitly nullable params
string $a = null
to explicitly nullable?string $a = null
(deprecated in PHP 8.4) - Identify and suggest renaming class-like nodes named
_
(deprecated in PHP 8.4)
- Convert implicitly nullable params
-
Add PHP 8.0 and 8.2 Deprecation Rules:
- Detect optional parameters before required ones (deprecated in PHP 8.0)
- Identify return by reference from void functions/methods/closures (deprecated in PHP 8.2)
Fixes
- Formatter:
- Preserve Single Inline Argument Formatting: Fixes an issue where a single argument to a function call would incorrectly break the parent nodes' formatting.
Full Changelog: 0.0.7...0.0.8