Skip to content

Commit

Permalink
docs: extend example for nullable_type_declaration (#7381)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Oct 19, 2023
1 parent 813b1d3 commit 1041f8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/rules/language_construct/nullable_type_declaration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Example #1
--- Original
+++ New
<?php
-function bar(null|int $value, null|\Closure $callable): void {}
+function bar(?int $value, ?\Closure $callable): void {}
-function bar(null|int $value, null|\Closure $callable): int|null {}
+function bar(?int $value, ?\Closure $callable): ?int {}
Example #2
~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getDefinition(): FixerDefinitionInterface
'Nullable single type declaration should be standardised using configured syntax.',
[
new VersionSpecificCodeSample(
"<?php\nfunction bar(null|int \$value, null|\\Closure \$callable): void {}\n",
"<?php\nfunction bar(null|int \$value, null|\\Closure \$callable): int|null {}\n",
new VersionSpecification(8_00_00)
),
new VersionSpecificCodeSample(
Expand Down

0 comments on commit 1041f8a

Please sign in to comment.