mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
cs: Enable more risky rules.
This commit is contained in:
@@ -22,8 +22,11 @@ use LogicException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use UnexpectedValueException;
|
||||
use function array_fill;
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function in_array;
|
||||
use function strtr;
|
||||
|
||||
/**
|
||||
@@ -236,7 +239,7 @@ break;
|
||||
$askedCenters = $args['centers'];
|
||||
|
||||
foreach ($reachableCenters as $center) {
|
||||
if (false === \in_array($center, $askedCenters)) {
|
||||
if (false === in_array($center, $askedCenters)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -246,14 +249,14 @@ break;
|
||||
$scopeIds = [];
|
||||
|
||||
foreach ($this->helper->getReachableScopes($this->security->getUser(), $role, $center) as $scope) {
|
||||
if (\in_array($scope->getId(), $scopeIds)) {
|
||||
if (in_array($scope->getId(), $scopeIds)) {
|
||||
continue;
|
||||
}
|
||||
$scopeIds[] = $scope->getId();
|
||||
}
|
||||
|
||||
$formattedClauses[] = strtr($centerScopesClause, [
|
||||
'{scopes_ids}' => implode(', ', array_fill(0, \count($scopeIds), '?')),
|
||||
'{scopes_ids}' => implode(', ', array_fill(0, count($scopeIds), '?')),
|
||||
]);
|
||||
// append $scopeIds to parameters
|
||||
$parameters = array_merge($parameters, $scopeIds);
|
||||
@@ -294,7 +297,7 @@ break;
|
||||
$scopes = $this->helper->getReachableScopes($this->security->getUser(), $role, $args['person']->getCenter());
|
||||
|
||||
foreach ($scopes as $scope) {
|
||||
if (\in_array($scope->getId(), $parameters)) {
|
||||
if (in_array($scope->getId(), $parameters)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -315,7 +318,7 @@ break;
|
||||
'{scopes_id}' => $reportScopeId,
|
||||
'{scopes_ids}' => implode(
|
||||
', ',
|
||||
array_fill(0, \count($parameters) - 1, '?')
|
||||
array_fill(0, count($parameters) - 1, '?')
|
||||
),
|
||||
]
|
||||
),
|
||||
|
Reference in New Issue
Block a user