Actually I would anything touching JSession just because we know the
framework team have decided to use symfony session package so I guess the
CMS might transition too in the not too distant future. So abstracting that
out is a good idea in my opinion

On Friday, April 25, 2014, Thomas Hunziker <notifications@github.com> wrote:

> In libraries/cms/controller/base.php:
>
> > +	 * @return void
> > +	 */
> > +	protected function refreshToken()
> > +	{
> > +		$session = JFactory::getSession();
> > +		$session->getToken(true);
> > +	}
> > +	
> > +	/**
> > +	 * Method to translate a string using JText::_() method
> > +	 * @param string $string
> > +	 * @return string translation result
> > +	 */
> > +	protected function translate($string)
> > +	{
> > +		return JText::_($string);
>
>  I did this because personally I don't like static functions spread all
> over the place.
>
> I'd say the uses in the controllers are out least concern here. If we ever
> are going to change JText::_(), we will have to change it in many many
> places. Let's do a proper replacement when JText is deprecated and not
> introduce a new method in a PR which has a completely different target.
> Personally I don't think that will happen anytime soon.
> As for the other wrappers (I think you mean the validateSession and
> refreshToken methods), I wouldn't do that neither. IMHO it just complicates
> the code.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/joomla/joomla-cms/pull/3503/files#r12007010>
> .
>