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 templates on QueryBuilder::getQuery return type (broken by #115). #122

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions stubs/Query.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Doctrine\ORM;

/**
* @template TKey as array-key
* @template TValue
*/
* @template TKey as array-key
* @template TValue
*/
class Query extends AbstractQuery
{
/**
Expand All @@ -19,6 +19,5 @@ class Query extends AbstractQuery
*/
public function getResult($hydrationMode = self::HYDRATE_OBJECT)
{

}
}
4 changes: 1 addition & 3 deletions stubs/QueryBuilder.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ class QueryBuilder
{
}


/**
* @return Query<mixed>
* @return Query<array-key, mixed>
*/
public function getQuery(): Query
{

}
}
9 changes: 9 additions & 0 deletions tests/acceptance/QueryBuilder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,12 @@ Feature: QueryBuilder
"""
When I run Psalm
Then I see no errors

@QueryBuilder
Scenario: QueryBuilder::getQuery() doesn't cause an error
Given I have the following code
"""
builder()->getQuery();
"""
When I run Psalm
Then I see no errors