Skip to content

Conversation

@annuh
Copy link

@annuh annuh commented Oct 26, 2022

Fixes #377.

Same as psalm/psalm-plugin-doctrine#115, but for PHPStan 🙂

*/
final class Query extends AbstractQuery
{
public const HYDRATE_OBJECT = 1;
Copy link
Author

Choose a reason for hiding this comment

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

This was needed to fix:

 ------ ------------------------------------------------ 
  Line   stubs/ORM/Query.stub                            
 ------ ------------------------------------------------ 
  23     PHPDoc tag @return contains unresolvable type.  
 ------ ------------------------------------------------ 

{
assertType(
'mixed',
'array<(int|string)>',
Copy link
Author

Choose a reason for hiding this comment

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

TBH, I'm not really sure about these changes but all the tests pass now 🙄

@annuh annuh marked this pull request as ready for review October 27, 2022 13:44
php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests

.PHONY: phpstan-generate-baseline
.PHONY: phpstan-generate-baselmake ine
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

namespace Doctrine\ORM;

/**
* @template TKey as array-key
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be conflicting with the solution propsed in #384

@ondrejmirtes
Copy link
Member

Superseded by 4490e56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QueryBuilder->getQuery() return type conflicts with Psalm

3 participants