Skip to content

Commit

Permalink
[ticket/13762] Replace user service with lang in twig extension
Browse files Browse the repository at this point in the history
PHPBB3-13762
  • Loading branch information
CHItA committed Apr 28, 2015
1 parent e0af281 commit 0b493ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpBB/config/default/container/services_twig.yml
Expand Up @@ -33,7 +33,7 @@ services:
class: phpbb\template\twig\extension
arguments:
- @template_context
- @user
- @language
tags:
- { name: twig.extension }

Expand Down
12 changes: 6 additions & 6 deletions phpBB/phpbb/template/twig/extension.php
Expand Up @@ -18,20 +18,20 @@ class extension extends \Twig_Extension
/** @var \phpbb\template\context */
protected $context;

/** @var \phpbb\user */
protected $user;
/** @var \phpbb\language\language */
protected $language;

/**
* Constructor
*
* @param \phpbb\template\context $context
* @param \phpbb\user $user
* @param \phpbb\language\language $language
* @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->user = $user;
$this->language = $language;
}

/**
Expand Down Expand Up @@ -181,6 +181,6 @@ function lang()
// LA_ is transformed into lang(\'$1\')|escape('js'), so we should not
// 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);
}
}

0 comments on commit 0b493ee

Please sign in to comment.