From 3e565d38301bb880538e15b1b0357ea1ebf7678e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 3 Jan 2021 13:52:08 +0100 Subject: [PATCH] Removed unnecesary if statements --- module/Core/src/Repository/ShortUrlRepository.php | 8 ++------ module/Core/src/Repository/TagRepository.php | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/module/Core/src/Repository/ShortUrlRepository.php b/module/Core/src/Repository/ShortUrlRepository.php index b4a2ec6e..4fa6fbd1 100644 --- a/module/Core/src/Repository/ShortUrlRepository.php +++ b/module/Core/src/Repository/ShortUrlRepository.php @@ -132,9 +132,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU ->andWhere($qb->expr()->in('t.name', $tags)); } - if ($spec) { - $this->applySpecification($qb, $spec, 's'); - } + $this->applySpecification($qb, $spec, 's'); return $qb; } @@ -198,9 +196,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU $this->whereDomainIs($qb, $domain); - if ($spec !== null) { - $this->applySpecification($qb, $spec, 's'); - } + $this->applySpecification($qb, $spec, 's'); return $qb; } diff --git a/module/Core/src/Repository/TagRepository.php b/module/Core/src/Repository/TagRepository.php index 71d291ef..a2cb5bfd 100644 --- a/module/Core/src/Repository/TagRepository.php +++ b/module/Core/src/Repository/TagRepository.php @@ -38,9 +38,7 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito ->groupBy('t') ->orderBy('t.name', 'ASC'); - if ($spec !== null) { - $this->applySpecification($qb, $spec, 't'); - } + $this->applySpecification($qb, $spec, 't'); $query = $qb->getQuery();