<commit_before><?php

namespace DotBlue\Templating\Helpers;

use InvalidArgumentException;


class Caller
{

	/** @var Registry */
	private $registry;



	public function __construct(Registry $registry)
	{
		$this->registry = $registry;
	}



	/**
	 * Allows calling registered helpers depending on locale.
	 *
	 * @param  ILocale
	 * @param  callable
	 */
	public function callWithLocalization(ILocale $locale, $callback)
	{
		$originalLocale = $this->registry->getLocale();
		$this->registry->setLocale($locale);
		call_user_func($callback, $this);
		$this->registry->setLocale($originalLocale);
	}<commit_msg>Caller: removed use of deprecate ILocale interface<commit_after><?php

namespace DotBlue\Templating\Helpers;

use InvalidArgumentException;


class Caller
{

	/** @var Registry */
	private $registry;



	public function __construct(Registry $registry)
	{
		$this->registry = $registry;
	}



	/**
	 * Allows calling registered helpers depending on locale.
	 *
	 * @param  mixed
	 * @param  callable
	 */
	public function callWithLocalization($locale, $callback)
	{
		$originalLocale = $this->registry->getLocale();
		$this->registry->setLocale($locale);
		call_user_func($callback, $this);
		$this->registry->setLocale($originalLocale);
	}
{'fraction_non_alphanumeric': 0.13189448441247004, 'fraction_numerical': 0.0, 'mean_word_length': 4.589285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5958991', 'n_tokens_mistral': 415, 'n_tokens_neox': 376, 'n_words': 83}