cs: Enable a couple of risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-24 12:38:18 +01:00
parent acc4647346
commit f531cdc0ec
51 changed files with 130 additions and 132 deletions

View File

@@ -187,7 +187,7 @@ class SingleTaskRepository extends EntityRepository
$this->buildACLQuery($qb, $currentUser);
}
if (array_key_exists('person', $params) and !empty($params['person'])) {
if (array_key_exists('person', $params) && !empty($params['person'])) {
$qb->andWhere($qb->expr()->eq('st.person', ':person'));
$qb->setParameter('person', $params['person']);
} elseif (array_key_exists('center', $params)) {
@@ -200,8 +200,8 @@ class SingleTaskRepository extends EntityRepository
}
}
if (array_key_exists('unassigned', $params) and true === $params['unassigned']) {
if (array_key_exists('user', $params) and !empty($params['user'])) {
if (array_key_exists('unassigned', $params) && true === $params['unassigned']) {
if (array_key_exists('user', $params) && !empty($params['user'])) {
throw new UnexpectedValueException('You should not require for '
. 'unassigned tasks and tasks assigned to some user.');
}
@@ -209,12 +209,12 @@ class SingleTaskRepository extends EntityRepository
$qb->andWhere($qb->expr()->isNull('st.assignee'));
}
if (array_key_exists('user', $params) and !empty($params['user'])) {
if (array_key_exists('user', $params) && !empty($params['user'])) {
$qb->andWhere($qb->expr()->eq('st.assignee', ':user'));
$qb->setParameter('user', $params['user']);
}
if (array_key_exists('scope', $params) and !empty($params['scope'])) {
if (array_key_exists('scope', $params) && !empty($params['scope'])) {
$qb->andWhere($qb->expr()->eq('st.circle', ':scope'));
$qb->setParameter('scope', $params['scope']);
}
@@ -226,7 +226,7 @@ class SingleTaskRepository extends EntityRepository
}
}
if (array_key_exists('date_status', $params) and !empty($params['date_status'])) {
if (array_key_exists('date_status', $params) && !empty($params['date_status'])) {
$this->addTypeFilter($qb, $params);
}