Pipeline corrections

This commit is contained in:
Julie Lenaerts 2025-01-14 13:31:29 +01:00
parent 8f84b1e137
commit 4ed3bec115
2 changed files with 11 additions and 11 deletions

View File

@ -37,7 +37,6 @@ use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -116,12 +115,8 @@ class CalendarController extends AbstractController
} }
#[Route(path: '/{_locale}/calendar/calendar/{id}/cancel', name: 'chill_calendar_calendar_cancel')] #[Route(path: '/{_locale}/calendar/calendar/{id}/cancel', name: 'chill_calendar_calendar_cancel')]
public function cancelAction(Calendar $calendar, Request $request): Response public function cancelAction(Calendar $calendar, Request $request): Response
{ {
// Deal with sms being sent or not
// Communicate cancellation with the remote calendar.
$this->denyAccessUnlessGranted(CalendarVoter::EDIT, $calendar); $this->denyAccessUnlessGranted(CalendarVoter::EDIT, $calendar);
[$person, $accompanyingPeriod] = [$calendar->getPerson(), $calendar->getAccompanyingPeriod()]; [$person, $accompanyingPeriod] = [$calendar->getPerson(), $calendar->getAccompanyingPeriod()];

View File

@ -1,5 +1,14 @@
<?php <?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\CalendarBundle\Form; namespace Chill\CalendarBundle\Form;
use Chill\CalendarBundle\Entity\Calendar; use Chill\CalendarBundle\Entity\Calendar;
@ -12,18 +21,14 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class CancelType extends AbstractType class CancelType extends AbstractType
{ {
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
{
}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->add('cancelReason', EntityType::class, [ $builder->add('cancelReason', EntityType::class, [
'class' => CancelReason::class, 'class' => CancelReason::class,
'required' => true, 'required' => true,
'choice_label' => function (CancelReason $cancelReason) { 'choice_label' => fn (CancelReason $cancelReason) => $this->translatableStringHelper->localize($cancelReason->getName()),
return $this->translatableStringHelper->localize($cancelReason->getName());
},
]); ]);
} }