mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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 Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Templating\Entity\PersonRender;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Templating\Entity\PersonRender;
|
||||
|
||||
class LocationValidityValidator extends ConstraintValidator
|
||||
{
|
||||
@@ -30,25 +37,24 @@ class LocationValidityValidator extends ConstraintValidator
|
||||
|
||||
if ($period->getLocationStatus() === 'person') {
|
||||
if (null === $period->getOpenParticipationContainsPerson(
|
||||
$period->getPersonLocation())) {
|
||||
$period->getPersonLocation()
|
||||
)) {
|
||||
$this->context->buildViolation($constraint->messagePersonLocatedMustBeAssociated)
|
||||
->setParameter('{{ person_name }}', $this->render->renderString(
|
||||
$period->getPersonLocation(), []
|
||||
))
|
||||
->addViolation()
|
||||
;
|
||||
->setParameter('{{ person_name }}', $this->render->renderString(
|
||||
$period->getPersonLocation(),
|
||||
[]
|
||||
))
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
|
||||
if ($period->getStep() !== AccompanyingPeriod::STEP_DRAFT
|
||||
&& $period->getLocationStatus() === 'none') {
|
||||
$this->context
|
||||
->buildViolation(
|
||||
$constraint->messagePeriodMustRemainsLocated
|
||||
)
|
||||
->addViolation()
|
||||
;
|
||||
->buildViolation(
|
||||
$constraint->messagePeriodMustRemainsLocated
|
||||
)
|
||||
->addViolation();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user