Doctrine-Specification icon indicating copy to clipboard operation
Doctrine-Specification copied to clipboard

Add countMatching()

Open holtkamp opened this issue 8 years ago • 8 comments

This allows simple counting functionality which return a single scalar result:

return (int) $this->countMatching($specification)->getSingleScalarResult();

holtkamp avatar Nov 05 '16 21:11 holtkamp

Coverage Status

Coverage decreased (-3.8%) to 95.804% when pulling b4e550703586bc3535117132a388f3a2cd18b3dd on holtkamp:patch-2 into 4a53c7ac1c6c332a0eabf61376281ee968691cbb on rikbruil:master.

coveralls avatar Nov 05 '16 21:11 coveralls

@rikbruil sorry for the lack of any tests. I had a look at existing tests / specifications, but this is quite complex for me at this point... No idea on how the added functionality should be tested...

Instead of a complete SELECT e FROM entity only a SELECT count(e) FROM entity is generated... hope the idea is clear.

holtkamp avatar Nov 07 '16 19:11 holtkamp

I will take a look at making the coverage better

rikbruil avatar Jan 05 '17 17:01 rikbruil

@rikbruil hey Rik, I am cleaning up "custom" code and I encountered this pending PR, would/could you consider merging it?

holtkamp avatar Sep 19 '17 11:09 holtkamp

Small reminder here as well

holtkamp avatar Feb 15 '20 14:02 holtkamp

Hi @rikbruil, are you still using this library? Still very powerful I would say...

holtkamp avatar Feb 01 '21 22:02 holtkamp

@holtkamp Hey Menno, sorry for the lack of responses here... I keep reading the notifications on my phone and then later forget them when I'm behind a keyboard again.

Yeah my employer is still using this in production, although personally I don't work that often with this library anymore since I'm rarely touching Doctrine lately. That's also why I've been a bit hesitant merging changes lately, since I'm not personally using it and can't directly see the impact of a merge on our production environment (unless the added code is covered well with tests).

I remember I looked into the coverage for this PR before, but I don't remember having a fix for it. I will take another look in the evening and get back to you here. Also, if you are still using this library a lot perhaps I could consider making you a maintainer as well? (if that's possible, I'm not sure on this).

Because I would hate for my late responses to block you if you are trying to use this library in production as well.

rikbruil avatar Feb 11 '21 09:02 rikbruil

@rikbruil no problemo and I fully understand.

Yes I use the library a lot and love the charm of it. So I am flattered for being asked as a maintainer. Stuff like static analysis and using GitHub Actions to trigger them would be nice to have and things I might be able to contribute....

holtkamp avatar Feb 11 '21 16:02 holtkamp