Symfony 3.0.2 При запуске бандла получаю ошибку:
ContextErrorException in GitkiExtension.php line 30: 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/www/teralit.local/var/cache/dev/appDevDebugProjectContainer.php on line 856 and defined
Собственно сам GitkiExtension.php:
use Dontdrinkandroot\GitkiBundle\Service\ExtensionRegistry\ExtensionRegistryInterface;
use Dontdrinkandroot\GitkiBundle\Service\Role\RoleServiceInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
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;
}
services.yml :
ddr.gitki.twig.gitki_extension:
class: Dontdrinkandroot\GitkiBundle\Twig\GitkiExtension
arguments:
- '@security.authorization_checker'
- '@ddr.gitki.service.role'
- '@ddr.gitki.registry.extension'
tags:
- { name: twig.extension }
Upd
Решение:
public function __construct(
AuthorizationCheckerInterface $securityContext,
RoleServiceInterface $roleService,
ExtensionRegistryInterface $extensionRegistry
){
$this->securityContext = $securityContext;
$this->roleService = $roleService;
$this->extensionRegistry = $extensionRegistry;
}