apply rules rector

This commit is contained in:
2023-07-19 22:48:26 +02:00
parent 6e6f19c499
commit 74ed34ba97
40 changed files with 250 additions and 697 deletions

View File

@@ -48,41 +48,17 @@ use function array_merge;
final class SingleTaskController extends AbstractController
{
private CenterResolverDispatcherInterface $centerResolverDispatcher;
private EventDispatcherInterface $eventDispatcher;
private FilterOrderHelperFactoryInterface $filterOrderHelperFactory;
private LoggerInterface $logger;
private PaginatorFactory $paginatorFactory;
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
private TimelineBuilder $timelineBuilder;
private TranslatorInterface $translator;
public function __construct(
CenterResolverDispatcherInterface $centerResolverDispatcher,
PaginatorFactory $paginatorFactory,
SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
TranslatorInterface $translator,
EventDispatcherInterface $eventDispatcher,
TimelineBuilder $timelineBuilder,
LoggerInterface $logger,
FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private CenterResolverDispatcherInterface $centerResolverDispatcher,
private PaginatorFactory $paginatorFactory,
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
private TranslatorInterface $translator,
private EventDispatcherInterface $eventDispatcher,
private TimelineBuilder $timelineBuilder,
private LoggerInterface $logger,
private FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private SingleTaskStateRepository $singleTaskStateRepository
) {
$this->eventDispatcher = $eventDispatcher;
$this->timelineBuilder = $timelineBuilder;
$this->logger = $logger;
$this->translator = $translator;
$this->centerResolverDispatcher = $centerResolverDispatcher;
$this->paginatorFactory = $paginatorFactory;
$this->singleTaskAclAwareRepository = $singleTaskAclAwareRepository;
$this->filterOrderHelperFactory = $filterOrderHelperFactory;
}
/**
@@ -90,10 +66,8 @@ final class SingleTaskController extends AbstractController
* "/{_locale}/task/single-task/{id}/delete",
* name="chill_task_single_task_delete"
* )
*
* @param mixed $id
*/
public function deleteAction(Request $request, $id)
public function deleteAction(Request $request, mixed $id)
{
$course = null;
$em = $this->getDoctrine()->getManager();
@@ -600,24 +574,19 @@ final class SingleTaskController extends AbstractController
}
}
switch ($entityType) {
case 'person':
return $this->render('@ChillTask/SingleTask/Person/new.html.twig', [
'form' => $form->createView(),
'task' => $task,
'person' => $task->getPerson(),
]);
case 'course':
return $this->render('@ChillTask/SingleTask/AccompanyingCourse/new.html.twig', [
'form' => $form->createView(),
'task' => $task,
'accompanyingCourse' => $task->getCourse(),
]);
default:
throw new LogicException('entity context not supported');
}
return match ($entityType) {
'person' => $this->render('@ChillTask/SingleTask/Person/new.html.twig', [
'form' => $form->createView(),
'task' => $task,
'person' => $task->getPerson(),
]),
'course' => $this->render('@ChillTask/SingleTask/AccompanyingCourse/new.html.twig', [
'form' => $form->createView(),
'task' => $task,
'accompanyingCourse' => $task->getCourse(),
]),
default => throw new LogicException('entity context not supported'),
};
}
/**
@@ -701,9 +670,8 @@ final class SingleTaskController extends AbstractController
/**
* Creates a form to delete a Task entity by id.
* @param mixed $id
*/
private function createDeleteForm($id): FormInterface
private function createDeleteForm(mixed $id): FormInterface
{
return $this->createFormBuilder()
->setAction($this->generateUrl(