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

Force return type cause TypeError on SingleScalarResult with 1 column #27

Open
Zul3s opened this issue May 24, 2022 · 1 comment
Open

Comments

@Zul3s
Copy link

Zul3s commented May 24, 2022

Hello,
First, thank for your job.

Second, i want to repport a problem :) .

When i have Doctrine Query with HYDRATE_SINGLE_SCALAR, and this contain only 1 column (ex. count), code have return an Type error because \Steevanb\DoctrineStats\Doctrine\ORM\Event\OverloadedHydratorTrait::hydrateAll need to return an array.

We can see \Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateAll doesn't have a PHP return type.
So i think we should juste remove PHP return type on \Steevanb\DoctrineStats\Doctrine\ORM\Event\OverloadedHydratorTrait::hydrateAll.

Exemple of query :

$repository->createQueryBuilder('t') ->select('count(t.id)') ->getQuery() ->getSingleScalarResult();

And error returned :

TypeError: Return value of Doctrine\ORM\Internal\Hydration\SingleScalarHydrator::hydrateAll() must be of the type array, string returned

I didn't see CODE OF CONDUCT, or Test on your projet, can you tell me how can help you to fix this ?

Regards.

@Zul3s
Copy link
Author

Zul3s commented Jun 28, 2022

Hello,
Any news ? Can i help ?

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

No branches or pull requests

1 participant