11diff --git a/tests/expected_report.txt b/tests/expected_report.txt
2- index c644926..d0f0a44 100644
2+ index c644926..d2640a7 100644
33--- a/tests/expected_report.txt
44+++ b/tests/expected_report.txt
5- @@ -15,18 +15,19 @@ tests/input/ControlStructures.php 28 0
5+ @@ -14,21 +14,22 @@ tests/input/constants-var.php 6 0
6+ tests/input/ControlStructures.php 28 0
67 tests/input/doc-comment-spacing.php 11 0
78 tests/input/duplicate-assignment-variable.php 1 0
8- tests/input/EarlyReturn.php 6 0
9+ - tests/input/EarlyReturn.php 6 0
910- tests/input/example-class.php 38 0
10- + tests/input/example-class.php 42 0
11+ + tests/input/EarlyReturn.php 7 0
12+ + tests/input/example-class.php 43 0
1113 tests/input/forbidden-comments.php 14 0
1214 tests/input/forbidden-functions.php 6 0
1315 tests/input/inline_type_hint_assertions.php 7 0
@@ -24,8 +26,11 @@ index c644926..d0f0a44 100644
2426 tests/input/null_coalesce_operator.php 3 0
2527+ tests/input/null_safe_operator.php 1 0
2628 tests/input/optimized-functions.php 1 0
27- tests/input/PropertyTypeHintSpacing.php 6 0
29+ - tests/input/PropertyTypeHintSpacing.php 6 0
30+ + tests/input/PropertyTypeHintSpacing.php 7 0
2831 tests/input/return_type_on_closures.php 21 0
32+ tests/input/return_type_on_methods.php 17 0
33+ tests/input/semicolon_spacing.php 3 0
2934@@ -39,15 +40,15 @@ tests/input/superfluous-naming.php 11 0
3035 tests/input/test-case.php 8 0
3136 tests/input/trailing_comma_on_array.php 1 0
@@ -35,16 +40,30 @@ index c644926..d0f0a44 100644
3540 tests/input/UnusedVariables.php 1 0
3641 tests/input/use-ordering.php 1 0
3742 tests/input/useless-semicolon.php 2 0
38- tests/input/UselessConditions.php 20 0
43+ - tests/input/UselessConditions.php 20 0
44+ + tests/input/UselessConditions.php 21 0
3945 ----------------------------------------------------------------------
4046- A TOTAL OF 377 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES
41- + A TOTAL OF 391 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
47+ + A TOTAL OF 395 ERRORS AND 0 WARNINGS WERE FOUND IN 42 FILES
4248 ----------------------------------------------------------------------
4349- PHPCBF CAN FIX 313 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
44- + PHPCBF CAN FIX 327 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
50+ + PHPCBF CAN FIX 331 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
4551 ----------------------------------------------------------------------
4652
4753
54+ diff --git a/tests/fixed/EarlyReturn.php b/tests/fixed/EarlyReturn.php
55+ index 5a82a93..7d5eb01 100644
56+ --- a/tests/fixed/EarlyReturn.php
57+ +++ b/tests/fixed/EarlyReturn.php
58+ @@ -11,7 +11,7 @@ class EarlyReturn
59+ return $bar === 'bar';
60+ }
61+
62+ - public function foo(): ?string
63+ + public function foo(): string|null
64+ {
65+ foreach ($itens as $item) {
66+ if (! $item->isItem()) {
4867diff --git a/tests/fixed/NamingCamelCase.php b/tests/fixed/NamingCamelCase.php
4968index 57d9f2b..5493471 100644
5069--- a/tests/fixed/NamingCamelCase.php
@@ -67,17 +86,41 @@ index 57d9f2b..5493471 100644
6786
6887 public function fcn(string $A): void
6988 {
89+ diff --git a/tests/fixed/PropertyTypeHintSpacing.php b/tests/fixed/PropertyTypeHintSpacing.php
90+ index 1421913..d52353c 100644
91+ --- a/tests/fixed/PropertyTypeHintSpacing.php
92+ +++ b/tests/fixed/PropertyTypeHintSpacing.php
93+ @@ -9,5 +9,5 @@ final class PropertyTypeHintSpacing
94+ public bool $boolPropertyWithDefaultValue = false;
95+ public string $stringProperty;
96+ public int $intProperty;
97+ - public ?string $nullableString = null;
98+ + public string|null $nullableString = null;
99+ }
100+ diff --git a/tests/fixed/UselessConditions.php b/tests/fixed/UselessConditions.php
101+ index 2151b17..71e0cfb 100644
102+ --- a/tests/fixed/UselessConditions.php
103+ +++ b/tests/fixed/UselessConditions.php
104+ @@ -95,7 +95,7 @@ class UselessConditions
105+ return false;
106+ }
107+
108+ - public function nullShouldNotBeTreatedAsFalse(): ?bool
109+ + public function nullShouldNotBeTreatedAsFalse(): bool|null
110+ {
111+ if (! $this->isAdmin) {
112+ return null;
70113diff --git a/tests/fixed/example-class.php b/tests/fixed/example-class.php
71- index 998e51d..b47d358 100644
114+ index 998e51d..56cd902 100644
72115--- a/tests/fixed/example-class.php
73116+++ b/tests/fixed/example-class.php
74- @@ -25,17 +25,14 @@ class Example implements IteratorAggregate
117+ @@ -25,19 +25,16 @@ class Example implements IteratorAggregate
75118 {
76119 private const VERSION = PHP_VERSION - (PHP_MINOR_VERSION * 100) - PHP_PATCH_VERSION;
77120
78121- /** @var int|null */
79122- private $foo;
80- + private ? int $foo = null;
123+ + private int|null $foo = null;
81124
82125 /** @var string[] */
83126- private $bar;
@@ -91,8 +134,20 @@ index 998e51d..b47d358 100644
91134- private $baxBax;
92135+ private ControlStructureSniff|int|string|null $baxBax = null;
93136
94- public function __construct(?int $foo = null, array $bar = [], bool $baz = false, $baxBax = 'unused')
137+ - public function __construct(?int $foo = null, array $bar = [], bool $baz = false, $baxBax = 'unused')
138+ + public function __construct(int|null $foo = null, array $bar = [], bool $baz = false, $baxBax = 'unused')
95139 {
140+ $this->foo = $foo;
141+ $this->bar = $bar;
142+ @@ -48,7 +45,7 @@ class Example implements IteratorAggregate
143+ /**
144+ * Description
145+ */
146+ - public function getFoo(): ?int
147+ + public function getFoo(): int|null
148+ {
149+ return $this->foo;
150+ }
96151diff --git a/tests/fixed/new_with_parentheses.php b/tests/fixed/new_with_parentheses.php
97152index 6e81bbe..47a06ec 100644
98153--- a/tests/fixed/new_with_parentheses.php
@@ -151,7 +206,7 @@ index 5bbb636..7ce8a3d 100644
151206- $var = $object === null ? null : $object->property;
152207+ $var = $object?->property;
153208diff --git a/tests/fixed/type-hints.php b/tests/fixed/type-hints.php
154- index 0e952fc..9824fb0 100644
209+ index 6033eca..5e26ed8 100644
155210--- a/tests/fixed/type-hints.php
156211+++ b/tests/fixed/type-hints.php
157212@@ -10,7 +10,7 @@ use Traversable;
@@ -163,3 +218,11 @@ index 0e952fc..9824fb0 100644
163218
164219 /**
165220 * @param Iterator $iterator
221+ @@ -25,6 +25,5 @@ class TraversableTypeHints
222+
223+ class UnionTypeHints
224+ {
225+ - /** @var int|string|null */
226+ - private $x = 1;
227+ + private int|string|null $x = 1;
228+ }
0 commit comments