DX: fix cs

This commit is contained in:
2023-02-17 22:20:09 +01:00
parent 542b6ccc83
commit 096e2f6e40
9 changed files with 52 additions and 26 deletions

View File

@@ -70,10 +70,10 @@ class AccompanyingPeriodController extends AbstractController
if ($person->isOpen() === false) {
$this->get('session')->getFlashBag()
->add('error', $this->get('translator')
->trans(
'Beware period is closed',
['%name%' => $person->__toString()]
));
->trans(
'Beware period is closed',
['%name%' => $person->__toString()]
));
return $this->redirect(
$this->generateUrl('chill_person_accompanying_period_list', [
@@ -99,9 +99,9 @@ class AccompanyingPeriodController extends AbstractController
if (count($errors) === 0) {
$this->get('session')->getFlashBag()
->add('success', $this->get('translator')
->trans('An accompanying period has been closed.', [
'%name%' => $person->__toString(),
]));
->trans('An accompanying period has been closed.', [
'%name%' => $person->__toString(),
]));
$this->getDoctrine()->getManager()->flush();
@@ -113,7 +113,7 @@ class AccompanyingPeriodController extends AbstractController
}
$this->get('session')->getFlashBag()
->add('error', $this->get('translator')
->trans('Error! Period not closed!'));
->trans('Error! Period not closed!'));
foreach ($errors as $error) {
$this->get('session')->getFlashBag()
@@ -251,10 +251,10 @@ class AccompanyingPeriodController extends AbstractController
if ($person->isOpen()) {
$this->get('session')->getFlashBag()
->add('error', $this->get('translator')
->trans(
'Error! Period %name% is not closed ; it can be open',
['%name%' => $person->__toString()]
));
->trans(
'Error! Period %name% is not closed ; it can be open',
['%name%' => $person->__toString()]
));
return $this->redirect(
$this->generateUrl('chill_person_accompanying_period_list', [
@@ -285,10 +285,10 @@ class AccompanyingPeriodController extends AbstractController
if (count($errors) <= 0) {
$this->get('session')->getFlashBag()
->add('success', $this->get('translator')
->trans(
'An accompanying period has been opened.',
['%name%' => $person->__toString()]
));
->trans(
'An accompanying period has been opened.',
['%name%' => $person->__toString()]
));
$this->getDoctrine()->getManager()->flush();
@@ -300,7 +300,7 @@ class AccompanyingPeriodController extends AbstractController
}
$this->get('session')->getFlashBag()
->add('error', $this->get('translator')
->trans('Period not opened'));
->trans('Period not opened'));
foreach ($errors as $error) {
$this->get('session')->getFlashBag()

View File

@@ -159,7 +159,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
$householdMember = new HouseholdMember();
$householdMember
->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position'])
->setShareHousehold(true))
->setShareHousehold(true))
->setHolder(true);
$person->addHouseholdParticipation($householdMember);
$household->addMember($householdMember);
@@ -171,7 +171,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
$householdMember = new HouseholdMember();
$householdMember
->setPosition((new Position())->setAllowHolder(true)->setLabel(['fr' => 'position2'])
->setShareHousehold(true))
->setShareHousehold(true))
->setHolder(false);
$person->addHouseholdParticipation($householdMember);
$household->addMember($householdMember);

View File

@@ -1,5 +1,14 @@
<?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 Validator\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -13,6 +22,10 @@ use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
/**
* @internal
* @coversNothing
*/
class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase
{
use ProphecyTrait;
@@ -101,8 +114,4 @@ class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase
{
return new ParticipationOverlap(['message' => 'participation-overlaps']);
}
}