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 ;
295
296
NoUnreachableDefaultArgumentValueFixer::class,
296
297
// There must be no `sprintf` calls with only the first argument.
297
298
NoUselessSprintfFixer::class,
299
+ // Add `?` before single type declarations when parameters have a default null value.
300
+ NullableTypeDeclarationForDefaultNullValueFixer::class,
298
301
// There must not be a space before colon in return type declarations.
299
302
ReturnTypeDeclarationFixer::class,
300
303
// Add `void` return type to functions with missing or empty return statements.
Original file line number Diff line number Diff line change @@ -169,6 +169,10 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
169
169
);
170
170
}
171
171
172
- // NullableTypeDeclarationFixer
173
- public function withParameters (?string $ nullableValue ): void {}
172
+ public function withParameters (
173
+ // NullableTypeDeclarationFixer
174
+ ?string $ nullableValue ,
175
+ // NullableTypeDeclarationForDefaultNullValueFixer
176
+ ?string $ anotherNullableValue = null ,
177
+ ): void {}
174
178
}
Original file line number Diff line number Diff line change @@ -166,7 +166,10 @@ but should be heredoc instead';
166
166
);
167
167
}
168
168
169
- // NullableTypeDeclarationFixer
170
- public function withParameters (null |string $ nullableValue ): void
171
- {}
169
+ public function withParameters (
170
+ // NullableTypeDeclarationFixer
171
+ null |string $ nullableValue ,
172
+ // NullableTypeDeclarationForDefaultNullValueFixer
173
+ string $ anotherNullableValue = null ,
174
+ ): void {}
172
175
}
You can’t perform that action at this time.
0 commit comments