We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm working on ORM 3 and DBAL 4 support on phpstan-doctrine, and I have this test case:
$this->entityManager->createQueryBuilder() ->select([ 'e.id', 'e.title', ])->from(MyEntity::class, 'e') ->getQuery();
When this method is called, Doctrine crashes with: Cannot use "::class" on array originating here:
Cannot use "::class" on array
orm/src/Query/Expr/Base.php
Line 63 in 5a40b99
Line 48 in 5a40b99
Line 36 in 5a40b99
orm/src/QueryBuilder.php
Line 620 in 5a40b99
This is how $select looks like when coming into new Expr\Select($select):
$select
new Expr\Select($select)
array(1) { [0]=> array(2) { [0]=> string(4) "e.id" [1]=> string(7) "e.title" } }
The method throws an exception.
It should work because even current 3.0 documentation mentions the possibility to pass arrays into the select method: https://www.doctrine-project.org/projects/doctrine-orm/en/3.0/reference/query-builder.html#high-level-api-methods
select
The text was updated successfully, but these errors were encountered:
More patches for Doctrine bugs
10869b3
Related: doctrine/orm#11240 Related: doctrine/orm#11241
d47e119
ce17b0e
Successfully merging a pull request may close this issue.
Bug Report
Summary
I'm working on ORM 3 and DBAL 4 support on phpstan-doctrine, and I have this test case:
When this method is called, Doctrine crashes with:
Cannot use "::class" on array
originating here:orm/src/Query/Expr/Base.php
Line 63 in 5a40b99
orm/src/Query/Expr/Base.php
Line 48 in 5a40b99
orm/src/Query/Expr/Base.php
Line 36 in 5a40b99
orm/src/QueryBuilder.php
Line 620 in 5a40b99
This is how
$select
looks like when coming intonew Expr\Select($select)
:Current behavior
The method throws an exception.
Expected behavior
It should work because even current 3.0 documentation mentions the possibility to pass arrays into the
select
method: https://www.doctrine-project.org/projects/doctrine-orm/en/3.0/reference/query-builder.html#high-level-api-methodsThe text was updated successfully, but these errors were encountered: