mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +00:00
update cs after php-cs-fixer upgrade
This commit is contained in:
@@ -160,7 +160,7 @@ final class SingleTaskController extends AbstractController
|
||||
#[Route(path: '/{_locale}/task/single-task/{id}/edit', name: 'chill_task_single_task_edit')]
|
||||
public function editAction(
|
||||
SingleTask $task,
|
||||
Request $request
|
||||
Request $request,
|
||||
) {
|
||||
$this->denyAccessUnlessGranted(TaskVoter::UPDATE, $task, 'You are not '
|
||||
.'allowed to edit this task');
|
||||
@@ -250,7 +250,7 @@ final class SingleTaskController extends AbstractController
|
||||
*/
|
||||
#[Route(path: '/{_locale}/task/single-task/list', name: 'chill_task_singletask_list')]
|
||||
public function listAction(
|
||||
Request $request
|
||||
Request $request,
|
||||
) {
|
||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, null);
|
||||
|
||||
@@ -305,7 +305,7 @@ final class SingleTaskController extends AbstractController
|
||||
public function listCourseTasks(
|
||||
AccompanyingPeriod $course,
|
||||
FormFactoryInterface $formFactory,
|
||||
Request $request
|
||||
Request $request,
|
||||
): Response {
|
||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $course);
|
||||
|
||||
@@ -350,7 +350,7 @@ final class SingleTaskController extends AbstractController
|
||||
|
||||
#[Route(path: '/{_locale}/task/single-task/by-person/{id}', name: 'chill_task_singletask_by-person_list')]
|
||||
public function listPersonTasks(
|
||||
Person $person
|
||||
Person $person,
|
||||
): Response {
|
||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $person);
|
||||
|
||||
|
@@ -52,7 +52,7 @@ class TaskController extends AbstractController
|
||||
EntityManagerInterface $em,
|
||||
Request $request,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
) {
|
||||
switch ($kind) {
|
||||
case 'single-task':
|
||||
|
@@ -32,7 +32,7 @@ class TaskLifecycleEvent implements EventSubscriberInterface
|
||||
|
||||
public function __construct(
|
||||
TokenStorageInterface $tokenStorage,
|
||||
EntityManagerInterface $em
|
||||
EntityManagerInterface $em,
|
||||
) {
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
$this->em = $em;
|
||||
|
@@ -55,7 +55,7 @@ class SingleTaskListType extends AbstractType
|
||||
EntityManagerInterface $em,
|
||||
TokenStorageInterface $tokenStorage,
|
||||
AuthorizationHelper $authorizationHelper,
|
||||
TaskWorkflowManager $taskWorkflowManager
|
||||
TaskWorkflowManager $taskWorkflowManager,
|
||||
) {
|
||||
$this->em = $em;
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
|
@@ -32,7 +32,7 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
public function __construct(
|
||||
AuthorizationCheckerInterface $authorizationChecker,
|
||||
TranslatorInterface $translator
|
||||
TranslatorInterface $translator,
|
||||
) {
|
||||
$this->translator = $translator;
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
|
@@ -31,7 +31,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
public function __construct(
|
||||
AuthorizationCheckerInterface $authorizationChecker,
|
||||
TranslatorInterface $translator
|
||||
TranslatorInterface $translator,
|
||||
) {
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
$this->translator = $translator;
|
||||
|
@@ -25,7 +25,7 @@ final readonly class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
private CountNotificationTask $counter,
|
||||
private TokenStorageInterface $tokenStorage,
|
||||
private TranslatorInterface $translator,
|
||||
private AuthorizationCheckerInterface $authorizationChecker
|
||||
private AuthorizationCheckerInterface $authorizationChecker,
|
||||
) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
|
@@ -29,7 +29,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?string $pattern = null,
|
||||
?array $flags = [],
|
||||
?array $types = [],
|
||||
?array $users = []
|
||||
?array $users = [],
|
||||
): QueryBuilder {
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
$qb
|
||||
@@ -149,7 +149,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
public function buildQueryByCourse(
|
||||
AccompanyingPeriod $course,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): QueryBuilder {
|
||||
$qb = $this->buildBaseQuery($pattern, $flags);
|
||||
|
||||
@@ -161,7 +161,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
public function buildQueryByPerson(
|
||||
Person $person,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): QueryBuilder {
|
||||
$qb = $this->buildBaseQuery($pattern, $flags);
|
||||
|
||||
@@ -172,7 +172,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
|
||||
public function buildQueryMyTasks(
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): QueryBuilder {
|
||||
$qb = $this->buildBaseQuery($pattern, $flags);
|
||||
|
||||
@@ -185,7 +185,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?string $pattern = null,
|
||||
?array $flags = [],
|
||||
?array $types = [],
|
||||
?array $users = []
|
||||
?array $users = [],
|
||||
): int {
|
||||
$qb = $this->buildBaseQuery($pattern, $flags, $types, $users);
|
||||
|
||||
@@ -198,7 +198,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
public function countByCourse(
|
||||
AccompanyingPeriod $course,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): int {
|
||||
$qb = $this->buildQueryByCourse($course, $pattern, $flags);
|
||||
|
||||
@@ -210,7 +210,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
|
||||
public function countByCurrentUsersTasks(
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): int {
|
||||
return $this->buildQueryMyTasks($pattern, $flags)
|
||||
->select('COUNT(t)')
|
||||
@@ -220,7 +220,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
public function countByPerson(
|
||||
Person $person,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): int {
|
||||
$qb = $this->buildQueryByPerson($person, $pattern, $flags);
|
||||
|
||||
@@ -237,7 +237,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?array $users = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array {
|
||||
$qb = $this->buildBaseQuery($pattern, $flags, $types, $users);
|
||||
$qb = $this->addACLGlobal($qb);
|
||||
@@ -251,7 +251,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array {
|
||||
$qb = $this->buildQueryByCourse($course, $pattern, $flags);
|
||||
$qb = $this->addACL($qb, $course);
|
||||
@@ -264,7 +264,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array {
|
||||
$qb = $this->buildQueryMyTasks($pattern, $flags);
|
||||
|
||||
@@ -277,7 +277,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array {
|
||||
$qb = $this->buildQueryByPerson($person, $pattern, $flags);
|
||||
$qb = $this->addACL($qb, $person);
|
||||
@@ -289,7 +289,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
QueryBuilder $qb,
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array {
|
||||
$qb->select('t');
|
||||
|
||||
@@ -306,7 +306,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
|
||||
private function addACL(
|
||||
QueryBuilder $qb,
|
||||
$entity
|
||||
$entity,
|
||||
): QueryBuilder {
|
||||
foreach ($this->centerResolverDispatcher->resolveCenters($entity) as $center) {
|
||||
$scopes = $this->authorizationHelper->getReachableScopes(
|
||||
@@ -323,7 +323,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR
|
||||
}
|
||||
|
||||
private function addACLGlobal(
|
||||
QueryBuilder $qb
|
||||
QueryBuilder $qb,
|
||||
): QueryBuilder {
|
||||
$allowedCenters = $this->authorizationHelper
|
||||
->getReachableCenters($this->security->getUser(), TaskVoter::SHOW);
|
||||
|
@@ -20,13 +20,13 @@ interface SingleTaskAclAwareRepositoryInterface
|
||||
?string $pattern = null,
|
||||
?array $flags = [],
|
||||
?array $types = [],
|
||||
?array $users = []
|
||||
?array $users = [],
|
||||
): int;
|
||||
|
||||
public function countByCourse(
|
||||
AccompanyingPeriod $course,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): int;
|
||||
|
||||
public function countByCurrentUsersTasks(?string $pattern = null, ?array $flags = []): int;
|
||||
@@ -34,7 +34,7 @@ interface SingleTaskAclAwareRepositoryInterface
|
||||
public function countByPerson(
|
||||
Person $person,
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
?array $flags = [],
|
||||
): int;
|
||||
|
||||
public function findByAllViewable(
|
||||
@@ -44,7 +44,7 @@ interface SingleTaskAclAwareRepositoryInterface
|
||||
?array $users = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array;
|
||||
|
||||
public function findByCourse(
|
||||
@@ -53,7 +53,7 @@ interface SingleTaskAclAwareRepositoryInterface
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array;
|
||||
|
||||
public function findByCurrentUsersTasks(?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array;
|
||||
@@ -64,6 +64,6 @@ interface SingleTaskAclAwareRepositoryInterface
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
?array $orderBy = [],
|
||||
): array;
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ class SingleTaskStateRepository
|
||||
SQL;
|
||||
|
||||
public function __construct(
|
||||
private readonly Connection $connection
|
||||
private readonly Connection $connection,
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@@ -28,7 +28,7 @@ class AuthorizationEvent extends \Symfony\Contracts\EventDispatcher\Event
|
||||
public function __construct(
|
||||
private readonly AbstractTask|AccompanyingPeriod|Person|null $subject,
|
||||
private readonly string $attribute,
|
||||
private readonly TokenInterface $token
|
||||
private readonly TokenInterface $token,
|
||||
) {}
|
||||
|
||||
public function getAttribute()
|
||||
|
@@ -52,7 +52,7 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
private readonly AccessDecisionManagerInterface $accessDecisionManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly LoggerInterface $logger,
|
||||
VoterHelperFactoryInterface $voterFactory
|
||||
VoterHelperFactoryInterface $voterFactory,
|
||||
) {
|
||||
$this->voter = $voterFactory
|
||||
->generate(AbstractTask::class)
|
||||
|
@@ -39,7 +39,7 @@ class TaskTwigExtension extends AbstractExtension
|
||||
AbstractTask $task,
|
||||
string $key,
|
||||
$metadataSubject = null,
|
||||
?string $name = null
|
||||
?string $name = null,
|
||||
) {
|
||||
return $this->taskWorkflowManager->getWorkflowMetadata($task, $key, $metadataSubject, $name);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ class CountNotificationTask implements NotificationCounterInterface
|
||||
|
||||
public function __construct(
|
||||
SingleTaskRepository $singleTaskRepository,
|
||||
CacheItemPoolInterface $cachePool
|
||||
CacheItemPoolInterface $cachePool,
|
||||
) {
|
||||
$this->singleTaskRepository = $singleTaskRepository;
|
||||
$this->cachePool = $cachePool;
|
||||
|
@@ -53,7 +53,7 @@ class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDe
|
||||
public function getWorkflowMetadata(
|
||||
AbstractTask $task,
|
||||
string $key,
|
||||
$metadataSubject = null
|
||||
$metadataSubject = null,
|
||||
) {
|
||||
$keys = \explode('.', $key);
|
||||
|
||||
|
Reference in New Issue
Block a user