Skip to content

Commit

Permalink
feat: update `Symfony.nullable_type_declaration_for_default_null_valu…
Browse files Browse the repository at this point in the history
…e` config (PHP-CS-Fixer#7773)
  • Loading branch information
keradus authored and danog committed Feb 2, 2024
1 parent 56775d8 commit 60cbd8a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions doc/ruleSets/Symfony.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ Rules
- `no_useless_nullsafe_operator <./../rules/operator/no_useless_nullsafe_operator.rst>`_
- `no_whitespace_before_comma_in_array <./../rules/array_notation/no_whitespace_before_comma_in_array.rst>`_
- `normalize_index_brace <./../rules/array_notation/normalize_index_brace.rst>`_
- `nullable_type_declaration_for_default_null_value <./../rules/function_notation/nullable_type_declaration_for_default_null_value.rst>`_ with config:

``['use_nullable_type_declaration' => false]``

- `nullable_type_declaration_for_default_null_value <./../rules/function_notation/nullable_type_declaration_for_default_null_value.rst>`_
- `object_operator_without_whitespace <./../rules/operator/object_operator_without_whitespace.rst>`_
- `operator_linebreak <./../rules/operator/operator_linebreak.rst>`_ with config:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ Rule sets

The rule is part of the following rule set:

- `@Symfony <./../../ruleSets/Symfony.rst>`_ with config:

``['use_nullable_type_declaration' => false]``

- `@Symfony <./../../ruleSets/Symfony.rst>`_

References
----------
Expand Down
2 changes: 1 addition & 1 deletion src/RuleSet/Sets/SymfonySet.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getRules(): array
'no_useless_nullsafe_operator' => true,
'no_whitespace_before_comma_in_array' => true,
'normalize_index_brace' => true,
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'operator_linebreak' => [
'only_booleans' => true,
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/Integration/misc/PHP7_1.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface Contract

class Implementation implements Contract
{
public function method(Foo $foo = null): ?bool
public function method(?Foo $foo = null): ?bool
{
return is_null($foo);
}
Expand Down Expand Up @@ -61,7 +61,7 @@ interface Contract {
}

class Implementation implements Contract {
public function method(?Foo $foo = null): ?bool
public function method(Foo $foo = null): ?bool
{
return is_null($foo);
}
Expand Down

0 comments on commit 60cbd8a

Please sign in to comment.