apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -30,11 +30,8 @@ use Chill\PersonBundle\Repository\PersonRepository;
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTimeImmutable;
use Exception;
use http\Exception\UnexpectedValueException;
use Psr\Log\LoggerInterface;
use RuntimeException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Form;
@@ -82,12 +79,12 @@ class CalendarController extends AbstractController
$view = '@ChillCalendar/Calendar/confirm_deleteByPerson.html.twig';
$redirectRoute = $this->generateUrl('chill_calendar_calendar_list_by_person', ['id' => $person->getId()]);
} else {
throw new RuntimeException('nor person or accompanying period');
throw new \RuntimeException('nor person or accompanying period');
}
$form = $this->createDeleteForm($entity);
if ($request->getMethod() === Request::METHOD_DELETE) {
if (Request::METHOD_DELETE === $request->getMethod()) {
$form->handleRequest($request);
if ($form->isValid()) {
@@ -138,7 +135,7 @@ class CalendarController extends AbstractController
$view = '@ChillCalendar/Calendar/editByPerson.html.twig';
$redirectRoute = $this->generateUrl('chill_calendar_calendar_list_by_person', ['id' => $person->getId()]);
} else {
throw new RuntimeException('no person nor accompanying period');
throw new \RuntimeException('no person nor accompanying period');
}
$form = $this->createForm(CalendarType::class, $entity)
@@ -148,7 +145,7 @@ class CalendarController extends AbstractController
$templates = $this->docGeneratorTemplateRepository->findByEntity(Calendar::class);
foreach ($templates as $template) {
$form->add('save_and_generate_doc_' . $template->getId(), SubmitType::class, [
$form->add('save_and_generate_doc_'.$template->getId(), SubmitType::class, [
'label' => $this->translatableStringHelper->localize($template->getName()),
]);
}
@@ -165,7 +162,7 @@ class CalendarController extends AbstractController
}
foreach ($templates as $template) {
if ($form->get('save_and_generate_doc_' . $template->getId())->isClicked()) {
if ($form->get('save_and_generate_doc_'.$template->getId())->isClicked()) {
return $this->redirectToRoute('chill_docgenerator_generate_from_template', [
'entityClassName' => Calendar::class,
'entityId' => $entity->getId(),
@@ -327,7 +324,7 @@ class CalendarController extends AbstractController
$form->add('save_and_upload_doc', SubmitType::class);
foreach ($templates as $template) {
$form->add('save_and_generate_doc_' . $template->getId(), SubmitType::class, [
$form->add('save_and_generate_doc_'.$template->getId(), SubmitType::class, [
'label' => $this->translatableStringHelper->localize($template->getName()),
]);
}
@@ -342,12 +339,12 @@ class CalendarController extends AbstractController
if ($form->get('save_and_upload_doc')->isClicked()) {
return $this->redirectToRoute('chill_calendar_calendardoc_new', [
'id' => $entity->getId()
'id' => $entity->getId(),
]);
}
foreach ($templates as $template) {
if ($form->get('save_and_generate_doc_' . $template->getId())->isClicked()) {
if ($form->get('save_and_generate_doc_'.$template->getId())->isClicked()) {
return $this->redirectToRoute('chill_docgenerator_generate_from_template', [
'entityClassName' => Calendar::class,
'entityId' => $entity->getId(),
@@ -392,7 +389,7 @@ class CalendarController extends AbstractController
*/
public function showAction(Request $request, int $id): Response
{
throw new Exception('not implemented');
throw new \Exception('not implemented');
$view = null;
$em = $this->getDoctrine()->getManager();
@@ -453,7 +450,7 @@ class CalendarController extends AbstractController
'entity' => $entity,
'user' => $user,
'activityData' => $activityData,
//'delete_form' => $deleteForm->createView(),
// 'delete_form' => $deleteForm->createView(),
]);
}
@@ -498,12 +495,12 @@ class CalendarController extends AbstractController
'returnPath' => $request->query->get('returnPath', null),
];
if ($calendar->getContext() === 'accompanying_period') {
if ('accompanying_period' === $calendar->getContext()) {
$routeParams['accompanying_period_id'] = $calendar->getAccompanyingPeriod()->getId();
} elseif ($calendar->getContext() === 'person') {
} elseif ('person' === $calendar->getContext()) {
$routeParams['person_id'] = $calendar->getPerson()->getId();
} else {
throw new RuntimeException('context not found for this calendar');
throw new \RuntimeException('context not found for this calendar');
}
return $this->redirectToRoute('chill_activity_activity_new', $routeParams);
@@ -512,7 +509,7 @@ class CalendarController extends AbstractController
private function buildListFilterOrder(): FilterOrderHelper
{
$filterOrder = $this->filterOrderHelperFactory->create(self::class);
$filterOrder->addDateRange('startDate', null, new DateTimeImmutable('3 days ago'), null);
$filterOrder->addDateRange('startDate', null, new \DateTimeImmutable('3 days ago'), null);
return $filterOrder->build();
}