mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -18,7 +18,6 @@ use Chill\PersonBundle\Form\HouseholdCompositionType;
|
||||
use Chill\PersonBundle\Repository\Household\HouseholdCompositionRepository;
|
||||
use Chill\PersonBundle\Repository\Household\HouseholdRepository;
|
||||
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
@@ -31,7 +30,6 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Templating\EngineInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class HouseholdCompositionController extends AbstractController
|
||||
@@ -71,7 +69,7 @@ class HouseholdCompositionController extends AbstractController
|
||||
->add('submit', SubmitType::class, ['label' => 'Delete'])
|
||||
->getForm();
|
||||
|
||||
if ($request->getMethod() === Request::METHOD_DELETE) {
|
||||
if (Request::METHOD_DELETE === $request->getMethod()) {
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
@@ -135,13 +133,13 @@ class HouseholdCompositionController extends AbstractController
|
||||
if ($isEdit) {
|
||||
$householdCompositions = $household->getCompositions()->filter(static fn (HouseholdComposition $composition) => $composition->getId() === $request->query->getInt('edit'));
|
||||
|
||||
if ($householdCompositions->count() !== 1) {
|
||||
if (1 !== $householdCompositions->count()) {
|
||||
throw new BadRequestHttpException('could not find the composition with this id associated to the household');
|
||||
}
|
||||
$householdComposition = $householdCompositions->first();
|
||||
} else {
|
||||
$householdComposition = (new HouseholdComposition())
|
||||
->setStartDate(new DateTimeImmutable());
|
||||
->setStartDate(new \DateTimeImmutable());
|
||||
}
|
||||
$form = $this->formFactory->create(HouseholdCompositionType::class, $householdComposition);
|
||||
|
||||
|
Reference in New Issue
Block a user