File tree 3 files changed +15
-5
lines changed
tests/Integration/Fixtures
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 77
77
use PhpCsFixer \Fixer \FunctionNotation \MethodArgumentSpaceFixer ;
78
78
use PhpCsFixer \Fixer \FunctionNotation \NoUnreachableDefaultArgumentValueFixer ;
79
79
use PhpCsFixer \Fixer \FunctionNotation \NoUselessSprintfFixer ;
80
+ use PhpCsFixer \Fixer \FunctionNotation \NullableTypeDeclarationForDefaultNullValueFixer ;
80
81
use PhpCsFixer \Fixer \FunctionNotation \PhpdocToParamTypeFixer ;
81
82
use PhpCsFixer \Fixer \FunctionNotation \PhpdocToPropertyTypeFixer ;
82
83
use PhpCsFixer \Fixer \FunctionNotation \PhpdocToReturnTypeFixer ;
296
297
NoUnreachableDefaultArgumentValueFixer::class,
297
298
// There must be no `sprintf` calls with only the first argument.
298
299
NoUselessSprintfFixer::class,
300
+ // Add `?` before single type declarations when parameters have a default null value.
301
+ NullableTypeDeclarationForDefaultNullValueFixer::class,
299
302
// There must not be a space before colon in return type declarations.
300
303
ReturnTypeDeclarationFixer::class,
301
304
// Add `void` return type to functions with missing or empty return statements.
Original file line number Diff line number Diff line change @@ -171,6 +171,10 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
171
171
);
172
172
}
173
173
174
- // NullableTypeDeclarationFixer
175
- public function withParameters (?string $ nullableValue ): void {}
174
+ public function withParameters (
175
+ // NullableTypeDeclarationFixer
176
+ ?string $ nullableValue ,
177
+ // NullableTypeDeclarationForDefaultNullValueFixer
178
+ ?string $ anotherNullableValue = null ,
179
+ ): void {}
176
180
}
Original file line number Diff line number Diff line change @@ -168,7 +168,10 @@ but should be heredoc instead';
168
168
);
169
169
}
170
170
171
- // NullableTypeDeclarationFixer
172
- public function withParameters (null |string $ nullableValue ): void
173
- {}
171
+ public function withParameters (
172
+ // NullableTypeDeclarationFixer
173
+ null |string $ nullableValue ,
174
+ // NullableTypeDeclarationForDefaultNullValueFixer
175
+ string $ anotherNullableValue = null ,
176
+ ): void {}
174
177
}
You can’t perform that action at this time.
0 commit comments