0

Доброго времени. Возникает следующая ошибка:

Catchable Fatal Error: Argument 1 passed to Dontdrinkandroot\GitkiBundle\Twig\GitkiExtension::__construct() must be an instance of Symfony\Component\Security\Core\Security, instance of Symfony\Component\Security\Core\Authorization\AuthorizationChecker given, called in /var/cache/dev/appDevDebugProjectContainer.php on line 856 and defined

Собственно сам Extention:

use Symfony\Component\Security\Core\Security;

class GitkiExtension extends \Twig_Extension
{

    /**
     * @var Security
     */
    private $securityContext;

    /**
     * @var ExtensionRegistryInterface
     */
    private $extensionRegistry;

    /**
     * @var RoleServiceInterface
     */
    private $roleService;

    public function __construct(Security $securityContext, RoleServiceInterface $roleService, ExtensionRegistryInterface $extensionRegistry){
        $this->securityContext = $securityContext;
        $this->roleService = $roleService;
        $this->extensionRegistry = $extensionRegistry;
    }

И сервис который передаёт параметры:

ddr.gitki.twig.gitki_extension:
    class: Dontdrinkandroot\GitkiBundle\Twig\GitkiExtension
    arguments:
        - '@security.authorization_checker'

1 ответ 1

1
public function __construct(
        AuthorizationCheckerInterface $securityContext,
        RoleServiceInterface $roleService,
        ExtensionRegistryInterface $extensionRegistry
        ){
    $this->securityContext = $securityContext;
    $this->roleService = $roleService;
    $this->extensionRegistry = $extensionRegistry;
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.