[Tech] Déplacement des méthodes qui concernent les statistiques vers un query service#5711
Open
[Tech] Déplacement des méthodes qui concernent les statistiques vers un query service#5711
Conversation
7d01e2d to
024d946
Compare
|
sfinx13
reviewed
Apr 15, 2026
| @@ -0,0 +1,68 @@ | |||
| <?php | |||
|
|
|||
| namespace App\Tests\Functional\Repository\Query\Dashboard; | |||
Collaborator
There was a problem hiding this comment.
Mettre à jour namespace, Statistics à la place Dashboard
Comment on lines
+73
to
+102
| public function countClosed(bool $removeImported = false): int | ||
| { | ||
| $qb = $this->entityManager->createQueryBuilder() | ||
| ->from(Signalement::class, 's') | ||
| ->select('COUNT(s.id)') | ||
| ->andWhere('s.statut = :closedStatus') | ||
| ->setParameter('closedStatus', SignalementStatus::CLOSED); | ||
|
|
||
| if ($removeImported) { | ||
| $qb->andWhere('s.isImported IS NULL OR s.isImported = 0'); | ||
| } | ||
|
|
||
| return (int) $qb->getQuery()->getSingleScalarResult(); | ||
| } | ||
|
|
||
| /** | ||
| * @throws NonUniqueResultException | ||
| * @throws NoResultException | ||
| */ | ||
| public function countRefused(): int | ||
| { | ||
| $qb = $this->entityManager->createQueryBuilder() | ||
| ->from(Signalement::class, 's') | ||
| ->select('COUNT(s.id)') | ||
| ->andWhere('s.statut = :refusedStatus') | ||
| ->setParameter('refusedStatus', SignalementStatus::REFUSED) | ||
| ->andWhere('s.isImported IS NULL OR s.isImported = 0'); | ||
|
|
||
| return (int) $qb->getQuery()->getSingleScalarResult(); | ||
| } |
Collaborator
There was a problem hiding this comment.
On pourrait en faire une seule méthode ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Ticket
#5622
Description
Déplacement des méthodes qui concernent les statistiques vers un query service
Pré-requis
make composerTests