DX: fix cs

This commit is contained in:
2023-02-06 17:47:54 +01:00
parent 4b2c330d22
commit 70871176fc
29 changed files with 100 additions and 74 deletions

View File

@@ -63,18 +63,18 @@ class RoleScopeScopePresence extends ConstraintValidator
//if the role scope should have a scope
if (
!in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes(), true)
&& $value->getScope() === null
) {
!in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes(), true)
&& $value->getScope() === null
) {
$this->context->buildViolation($constraint->messagePresenceRequired)
->setParameter('%role%', $this->translator->trans($value->getRole()))
->addViolation();
$this->logger->debug('the role scope should have a scope, but scope is null. Violation build.');
} elseif // if the scope should be null
(
in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes(), true)
&& null !== $value->getScope()
) {
(
in_array($value->getRole(), $this->roleProvider->getRolesWithoutScopes(), true)
&& null !== $value->getScope()
) {
$this->context->buildViolation($constraint->messageNullRequired)
->setParameter('%role%', $this->translator->trans($value->getRole()))
->addViolation();