mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix service dependency injection for validatorInterface
This commit is contained in:
@@ -14,6 +14,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Role\RoleHierarchy;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Form\Type\ComposedRoleScopeType;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
@@ -43,6 +44,11 @@ class PermissionsGroupController extends AbstractController
|
||||
*/
|
||||
private $translator;
|
||||
|
||||
/**
|
||||
* @var ValidatorInterface
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
/**
|
||||
* PermissionsGroupController constructor.
|
||||
*
|
||||
@@ -50,18 +56,21 @@ class PermissionsGroupController extends AbstractController
|
||||
* @param RoleProvider $roleProvider
|
||||
* @param RoleHierarchy $roleHierarchy
|
||||
* @param TranslatorInterface $translator
|
||||
* @param ValidatorInterface $validator
|
||||
*/
|
||||
public function __construct(
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
RoleProvider $roleProvider,
|
||||
RoleHierarchy $roleHierarchy,
|
||||
TranslatorInterface $translator
|
||||
TranslatorInterface $translator,
|
||||
ValidatorInterface $validator
|
||||
)
|
||||
{
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->roleProvider = $roleProvider;
|
||||
$this->roleHierarchy = $roleHierarchy;
|
||||
$this->translator = $translator;
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -452,7 +461,7 @@ class PermissionsGroupController extends AbstractController
|
||||
);
|
||||
|
||||
$permissionsGroup->addRoleScope($roleScope);
|
||||
$violations = $this->get('validator')->validate($permissionsGroup);
|
||||
$violations = $this->validator->validate($permissionsGroup);
|
||||
|
||||
if ($violations->count() === 0) {
|
||||
$em->flush();
|
||||
|
Reference in New Issue
Block a user