mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
csfixes
This commit is contained in:
@@ -18,12 +18,12 @@ use Symfony\Component\Validator\Constraint;
|
||||
*/
|
||||
class AccompanyingPeriodValidity extends Constraint
|
||||
{
|
||||
public $messageSocialIssueCannotBeDeleted = 'The social %name% issue cannot be deleted because it is associated with an activity or an action';
|
||||
|
||||
public $messageReferrerIsCurrentUser = 'Only the referrer can change the confidentiality of a parcours';
|
||||
|
||||
public $messageReferrerIsNull = 'A confidential parcours must have a referrer';
|
||||
|
||||
public $messageSocialIssueCannotBeDeleted = 'The social %name% issue cannot be deleted because it is associated with an activity or an action';
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
|
@@ -97,14 +97,14 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
$user = $period->getUser();
|
||||
$currentUser = $this->token->getToken()->getUser();
|
||||
|
||||
if ($user && ($user != $currentUser) && $period->isConfidential() == true) {
|
||||
if ($user && ($user !== $currentUser) && $period->isConfidential() === true) {
|
||||
$this->context->buildViolation($constraint->messageReferrerIsCurrentUser)
|
||||
->addViolation();
|
||||
->addViolation();
|
||||
}
|
||||
|
||||
if ($user == null && $period->isConfidential() == true) {
|
||||
if (null === $user && $period->isConfidential() === true) {
|
||||
$this->context->buildViolation($constraint->messageReferrerIsNull)
|
||||
->addViolation();
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user