Fix crudconfig

This commit is contained in:
2024-04-24 11:44:14 +02:00
parent 56d5d08ed3
commit 650e85c481
2 changed files with 10 additions and 17 deletions

View File

@@ -22,7 +22,7 @@ use Symfony\Component\Routing\Annotation\Route;
class CSPersonController extends OneToOneEntityPersonCRUDController
{
public function personalSituationEdit(Request $request, $id)
public function personalSituationEdit(Request $request, $id): Response
{
return $this->formEditAction(
'ps_situation_edit',
@@ -72,7 +72,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
return $this->generateUrl($route, ['id' => $entity->getPerson()->getId()]);
}
protected function checkACL($action, $entity)
protected function checkACL($action, $entity): void
{
match ($action) {
'ps_situation_edit', 'dispositifs_edit' => $this->denyAccessUnlessGranted(
@@ -116,16 +116,8 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
{
switch ($action) {
case 'dispositifs_edit':
$form = $this->createForm($formClass, $entity, \array_merge(
$formOptions,
['center' => $entity->getPerson()->getCenter()]
));
$this->customizeForm($action, $form);
return $form;
case 'ps_situation_edit':
case 'dispositifs_edit':
$form = $this->createForm($formClass, $entity, \array_merge(
$formOptions,
['center' => $entity->getPerson()->getCenter()]
@@ -139,7 +131,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
}
}
protected function generateLabelForButton($action, $formName, $form)
protected function generateLabelForButton($action, $formName, $form): string
{
switch ($action) {
case 'ps_situation_edit':