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

Fix union type on QueryExpressionVisitorTest::testWalkComparison() #9294

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void
}

/**
* @param QueryBuilder\Comparison|string $queryExpr
* @param QueryBuilder\Comparison|QueryBuilder\Func|string $queryExpr
*
* @dataProvider comparisonData
*/
Expand All @@ -39,7 +39,13 @@ public function testWalkComparison(CriteriaComparison $criteriaExpr, $queryExpr,
}
}

/** @psalm-return list<array{CriteriaComparison, QueryBuilder\Comparison|string, ?Parameter} */
/**
* @psalm-return list<array{
* 0: CriteriaComparison,
* 1: QueryBuilder\Comparison|QueryBuilder\Func|string,
* 2?: Parameter,
Copy link
Member

@greg0ire greg0ire Dec 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this different than the previous specification for this parameter? Previously it meant always present but possibly null, whereas here it would mean never null, but optional? If there is no difference then are the numbers necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. And if you look at the data provider you'll find that the declaration "never null, but optional" is more accurate.

Oh, and the closing > was missing, so the previous type declaration was invalid and thus ignored.

* }>
*/
public function comparisonData(): array
{
$cb = new CriteriaBuilder();
Expand Down