mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
fix: SA: Fix "...Instantiated class not found..." rules.
SA stands for Static Analysis.
This commit is contained in:
@@ -38,7 +38,7 @@ class HouseholdMemberController extends ApiController
|
||||
$this->translator = $translator;
|
||||
$this->periodRepository = $periodRepository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Route(
|
||||
* "/api/1.0/person/household/members/move.{_format}",
|
||||
@@ -75,7 +75,7 @@ class HouseholdMemberController extends ApiController
|
||||
}
|
||||
|
||||
foreach ($editor->getPersistable() as $el) {
|
||||
$em->persist($el);
|
||||
$em->persist($el);
|
||||
}
|
||||
$em->flush();
|
||||
|
||||
@@ -89,8 +89,8 @@ class HouseholdMemberController extends ApiController
|
||||
*
|
||||
* * persons[]: an id of the person to add to the form
|
||||
* * household: the id of the destination household
|
||||
* * allow_leave_without_household: if present, the editor will allow
|
||||
* to leave household without joining another
|
||||
* * allow_leave_without_household: if present, the editor will allow
|
||||
* to leave household without joining another
|
||||
*
|
||||
* @Route(
|
||||
* "/{_locale}/person/household/members/editor",
|
||||
@@ -105,7 +105,7 @@ class HouseholdMemberController extends ApiController
|
||||
$ids = $request->query->get('persons', []);
|
||||
|
||||
if (0 === count($ids)) {
|
||||
throw new BadRequestExceptions("parameters persons in query ".
|
||||
throw new BadRequestException("parameters persons in query ".
|
||||
"is not an array or empty");
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class HouseholdMemberController extends ApiController
|
||||
;
|
||||
|
||||
foreach ($persons as $person) {
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person,
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person,
|
||||
"You are not allowed to see person with id {$person->getId()}"
|
||||
);
|
||||
}
|
||||
@@ -140,11 +140,11 @@ class HouseholdMemberController extends ApiController
|
||||
;
|
||||
|
||||
$data = [
|
||||
'persons' => $persons ?? false ?
|
||||
'persons' => $persons ?? false ?
|
||||
$this->getSerializer()->normalize($persons, 'json', [ 'groups' => [ 'read' ]]) : [],
|
||||
'household' => $household ?? false ?
|
||||
$this->getSerializer()->normalize($household, 'json', [ 'groups' => [ 'read' ]]) : null,
|
||||
'positions' =>
|
||||
'positions' =>
|
||||
$this->getSerializer()->normalize($positions, 'json', [ 'groups' => [ 'read' ]]),
|
||||
'allowHouseholdCreate' => $allowHouseholdCreate ?? true,
|
||||
'allowHouseholdSearch' => $allowHouseholdSearch ?? true,
|
||||
@@ -182,7 +182,7 @@ class HouseholdMemberController extends ApiController
|
||||
// TODO ACL
|
||||
|
||||
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
||||
'validation_groups' => [ 'household_memberships' ]
|
||||
'validation_groups' => [ 'household_memberships' ]
|
||||
]);
|
||||
$form->handleRequest($request);
|
||||
|
||||
@@ -190,12 +190,12 @@ class HouseholdMemberController extends ApiController
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
$this->addFlash('success', $this->translator
|
||||
->trans('household.successfully saved member'))
|
||||
->trans('household.successfully saved member'))
|
||||
;
|
||||
|
||||
return $this->redirect(
|
||||
$request->get('returnPath', null) ??
|
||||
$this->generator->generate('chill_person_household_summary', [ 'household_id' =>
|
||||
$this->generator->generate('chill_person_household_summary', [ 'household_id' =>
|
||||
$member->getHousehold()->getId() ])
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user