From 7748a4282df19daf966fda1d8c60a8aec803c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Sun, 23 Feb 2025 19:12:49 +0100 Subject: [PATCH] Added test --- tests/Helpers/FunctionHelperTest.php | 8 ++++++++ tests/Helpers/data/functionParametersTypeHints.php | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/Helpers/FunctionHelperTest.php b/tests/Helpers/FunctionHelperTest.php index ea469e72c..a87aae12f 100644 --- a/tests/Helpers/FunctionHelperTest.php +++ b/tests/Helpers/FunctionHelperTest.php @@ -174,6 +174,14 @@ public static function dataParametersTypeHints(): array '$d' => new TypeHint('string|int|float', false, 0, 0), ], ], + [ + 'dnf', + [ + '$a' => new TypeHint('(A&B)|C|D', false, 0, 0), + '$b' => new TypeHint('A|(B&C)|D', false, 0, 0), + '$c' => new TypeHint('A|B|(C&D)', false, 0, 0), + ], + ], ]; } diff --git a/tests/Helpers/data/functionParametersTypeHints.php b/tests/Helpers/data/functionParametersTypeHints.php index 197daa52c..47abbeefd 100644 --- a/tests/Helpers/data/functionParametersTypeHints.php +++ b/tests/Helpers/data/functionParametersTypeHints.php @@ -1,4 +1,4 @@ -= 8.0 += 8.2 namespace FooNamespace; @@ -22,4 +22,12 @@ abstract public function parametersWithWeirdDefinition(string$string,$int,bool$b public function unionTypeHints(string|int $a, int|false $b, null|int $c, string | int | float $d) {} + public function dnf( + (A&B)|C|D $a, + A|(B&C)|D $b, + A|B|(C&D) $c, + ) { + + } + }