Removed unnecesary if statements

This commit is contained in:
Alejandro Celaya 2021-01-03 13:52:08 +01:00
parent dc08286a72
commit 3e565d3830
2 changed files with 3 additions and 9 deletions

View File

@ -132,9 +132,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
->andWhere($qb->expr()->in('t.name', $tags)); ->andWhere($qb->expr()->in('t.name', $tags));
} }
if ($spec) {
$this->applySpecification($qb, $spec, 's'); $this->applySpecification($qb, $spec, 's');
}
return $qb; return $qb;
} }
@ -198,9 +196,7 @@ class ShortUrlRepository extends EntitySpecificationRepository implements ShortU
$this->whereDomainIs($qb, $domain); $this->whereDomainIs($qb, $domain);
if ($spec !== null) {
$this->applySpecification($qb, $spec, 's'); $this->applySpecification($qb, $spec, 's');
}
return $qb; return $qb;
} }

View File

@ -38,9 +38,7 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito
->groupBy('t') ->groupBy('t')
->orderBy('t.name', 'ASC'); ->orderBy('t.name', 'ASC');
if ($spec !== null) {
$this->applySpecification($qb, $spec, 't'); $this->applySpecification($qb, $spec, 't');
}
$query = $qb->getQuery(); $query = $qb->getQuery();