Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Feb 23, 2025
1 parent 5e3b792 commit 7748a42
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/Helpers/FunctionHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
],
];
}

Expand Down
10 changes: 9 additions & 1 deletion tests/Helpers/data/functionParametersTypeHints.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // lint >= 8.0
<?php // lint >= 8.2

namespace FooNamespace;

Expand All @@ -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,
) {

}

}

0 comments on commit 7748a42

Please sign in to comment.