/**
  * {@inheritdoc}
  */
 public function initRuntime(Twig_Environment $environment)
 {
     /** @var $environment sfTwigEnvironment */
     if ($environment instanceof sfTwigEnvironment) {
         $this->sfContext = $environment->getContext();
     } else {
         throw new \InvalidArgumentException('$environment must be instance of sfTwigEnvironment class');
     }
     parent::initRuntime($environment);
 }