[ticket/13762] Replace user service with lang in twig extension

PHPBB3-13762
This commit is contained in:
MateBartus 2015-04-29 01:00:13 +02:00
parent 9f1f6f96ce
commit 9a99c9e4b1
2 changed files with 7 additions and 7 deletions

View file

@ -33,7 +33,7 @@ services:
class: phpbb\template\twig\extension class: phpbb\template\twig\extension
arguments: arguments:
- @template_context - @template_context
- @user - @language
tags: tags:
- { name: twig.extension } - { name: twig.extension }

View file

@ -18,20 +18,20 @@ class extension extends \Twig_Extension
/** @var \phpbb\template\context */ /** @var \phpbb\template\context */
protected $context; protected $context;
/** @var \phpbb\user */ /** @var \phpbb\language\language */
protected $user; protected $language;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\template\context $context * @param \phpbb\template\context $context
* @param \phpbb\user $user * @param \phpbb\language\language $language
* @return \phpbb\template\twig\extension * @return \phpbb\template\twig\extension
*/ */
public function __construct(\phpbb\template\context $context, $user) public function __construct(\phpbb\template\context $context, $language)
{ {
$this->context = $context; $this->context = $context;
$this->user = $user; $this->language = $language;
} }
/** /**
@ -181,6 +181,6 @@ class extension extends \Twig_Extension
// LA_ is transformed into lang(\'$1\')|escape('js'), so we should not // LA_ is transformed into lang(\'$1\')|escape('js'), so we should not
// need to check for it // need to check for it
return call_user_func_array(array($this->user, 'lang'), $args); return call_user_func_array(array($this->language, 'lang'), $args);
} }
} }