diff --git a/flextype/twig/CsrfTwigExtension.php b/flextype/twig/CsrfTwigExtension.php index b588f69f..f6c655d9 100644 --- a/flextype/twig/CsrfTwigExtension.php +++ b/flextype/twig/CsrfTwigExtension.php @@ -16,15 +16,17 @@ use Twig_SimpleFunction; class CsrfTwigExtension extends Twig_Extension implements Twig_Extension_GlobalsInterface { - /** @var Guard */ - protected $csrf; + /** + * Flextype Dependency Container + */ + private $flextype; /** * Constructor */ - public function __construct(Guard $csrf) + public function __construct($flextype) { - $this->csrf = $csrf; + $this->flextype = $flextype; } /** @@ -33,10 +35,10 @@ class CsrfTwigExtension extends Twig_Extension implements Twig_Extension_Globals public function getGlobals() { // CSRF token name and value - $csrfNameKey = $this->csrf->getTokenNameKey(); - $csrfValueKey = $this->csrf->getTokenValueKey(); - $csrfName = $this->csrf->getTokenName(); - $csrfValue = $this->csrf->getTokenValue(); + $csrfNameKey = $this->flextype->csrf->getTokenNameKey(); + $csrfValueKey = $this->flextype->csrf->getTokenValueKey(); + $csrfName = $this->flextype->csrf->getTokenName(); + $csrfValue = $this->flextype->csrf->getTokenValue(); return [ 'csrf' => [ @@ -72,7 +74,7 @@ class CsrfTwigExtension extends Twig_Extension implements Twig_Extension_Globals */ public function csrf() : string { - return '' . - ''; + return '' . + ''; } }