Rector changes + namespace changes

This commit is contained in:
2024-04-23 17:43:23 +02:00
parent 63fe8070c4
commit ed3e0f889e
116 changed files with 816 additions and 831 deletions

View File

@@ -9,15 +9,16 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ChillJobBundle\Controller;
namespace Chill\JobBundle\Controller;
use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Chill\ChillJobBundle\Form\CSPersonPersonalSituationType;
use Chill\ChillJobBundle\Form\CSPersonDispositifsType;
use Chill\JobBundle\Form\CSPersonPersonalSituationType;
use Chill\JobBundle\Form\CSPersonDispositifsType;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CSPersonController extends OneToOneEntityPersonCRUDController
{
@@ -41,18 +42,22 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
);
}
public function personalSituationView(Request $request, $id): Response
#[Route(path: '{_locale}/person/job/{person}/personal_situation', name: 'chill_job_personal_situation_view')]
public function personalSituationView(Request $request, $person): Response
{
return $this->viewAction('ps_situation_view', $request, $id);
return $this->viewAction('ps_situation_view', $request, $person);
}
public function dispositifsView(Request $request, $id): Response
#[Route(path: '{_locale}/person/job/{person}/dispositifs', name: 'chill_job_dispositifs_view')]
public function dispositifsView(Request $request, $person): Response
{
return $this->viewAction('dispositifs_view', $request, $id);
return $this->viewAction('dispositifs_view', $request, $person);
}
protected function generateRedirectOnCreateRoute($action, Request $request, $entity)
protected function generateRedirectOnCreateRoute($action, Request $request, $entity): string
{
$route = '';
switch ($action) {
case 'ps_situation_view':
$route = 'chill_crud_csperson_personal_situation_edit';
@@ -82,7 +87,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
};
}
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response
{
return match ($action) {
'ps_situation_edit' => $this->redirectToRoute(
@@ -101,13 +106,13 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
{
switch ($action) {
case 'ps_situation_edit':
return '@CSConnectesSP/CSPerson/personal_situation_edit.html.twig';
return '@ChillJob/CSPerson/personal_situation_edit.html.twig';
case 'dispositifs_edit':
return '@CSConnectesSP/CSPerson/dispositifs_edit.html.twig';
return '@ChillJob/CSPerson/dispositifs_edit.html.twig';
case 'ps_situation_view':
return '@CSConnectesSP/CSPerson/personal_situation_view.html.twig';
return '@ChillJob/CSPerson/personal_situation_view.html.twig';
case 'dispositifs_view':
return '@CSConnectesSP/CSPerson/dispositifs_view.html.twig';
return '@ChillJob/CSPerson/dispositifs_view.html.twig';
default:
parent::getTemplateFor($action, $entity, $request);
}
@@ -150,7 +155,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
throw new \LogicException("this formName is not supported: {$formName}");
break;
default:
return parent::generateLabelForButton($action, $formName, $form);
return 'Enregistrer';
}
}
}