Actually, only router was used by retrieving it from the container. Now
injecting only what is necessary.
Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\Routing\Router;
use KekRozsak\SecurityBundle\Entity\User;
class UserDataSpanExtension extends \Twig_Extension
{
protected $_securityContext;
protected $_serviceContainer;
protected $_router;
public function __construct(ContainerInterface $container, SecurityContextInterface $security)
public function __construct(Router $router, SecurityContextInterface $security)
{
$this->_serviceContainer = $container;
$this->_router = $router;
$this->_securityContext = $security;
}
@ -30,7 +30,7 @@ class UserDataSpanExtension extends \Twig_Extension
if (!is_object($this->_securityContext->getToken()) || !is_object($this->_securityContext->getToken()->getUser()))
return '<spanclass="userdata-secret"title="|Felhasználó|A felhasználóink kiléte szigorúan bizalmas, csak a tagok számára elérhető.">[nem jelenhet meg]</span>';