Enhancements
- Linter:
- Added PHPUnit plugin: Introduces basic rules for improving PHPUnit usage. Enable it with:
[linter] plugins = ["phpunit"]
- Added PHPUnit plugin: Introduces basic rules for improving PHPUnit usage. Enable it with:
Fixes
-
Formatter:
- Wrap method call chain base in parentheses when needed: Fixes an issue where parentheses were omitted incorrectly in cases like
($foo ?? $bar)->bar()->baz()->qux()->quxx(), resulting in$foo ?? $bar->bar()->baz()->qux()->quxx()
Reported in #20 by @bendavies. - Default to next line in method chains: Ensures that the first method call in a chain starts on the next line, following PER CS 2.0 standards.
- Add missing parentheses around assignment LHS of array access: Fixes an issue where
$a ?? $b[$foo]was misinterpreted due to missing parentheses in($a ?? $b)[$foo].
Reported in #18 by @bendavies. - Remove leading comma in argument lists: Fixes a bug where arguments like
foo($expr)were incorrectly formatted asfoo(, $expr).
Reported in #19 by @bendavies.
- Wrap method call chain base in parentheses when needed: Fixes an issue where parentheses were omitted incorrectly in cases like
-
Linter:
- Fix the fix plan for
use-while-instead-of-for: Resolves an issue wherefor (;;)was incorrectly replaced withfor (; )instead ofwhile (true).
Reported in #21 by @bendavies.
- Fix the fix plan for
Special thanks to @bendavies for testing and reporting several issues!
Full Changelog: 0.0.6...0.0.7