Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update Symfony.nullable_type_declaration_for_default_null_value config #7773

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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