<commit_before><?php

namespace Lotofootv2\Bundle\Twig\Extension;

use Lotofootv2\Bundle\Service\RewardService;

use Symfony\Component\Security\Core\SecurityContext;
use Doctrine\ORM\EntityManager;


class Lotofootv2Extensions extends \Twig_Extension
{
	protected $rewardService;

    public function __construct(RewardService $rewardService)
    {
        $this->rewardService = $rewardService;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getFunctions()
    {
        return array(
            'rewards' => new \Twig_Function_Method($this, 'getRewards', array('is_safe' => array('html'))),
          	'pot' => new \Twig_Function_Method($this, 'getPot', array('is_safe' => array('html'))),
            'reqKeyOrDefault' => new \Twig_Function_Method($this, 'reqKeyOrDefault', array('is_safe' => array('html'))),
        );
    }
    
    public function getRewards($accountId){
    	return $this->rewardService->getAccountRewards($accountId);
    }
    
    public function reqKeyOrDefault($request, $key, $default){
    	if($request->request->has($key)){
    		return $request->request->get($key);
    	}
        return $default;
    }
    
	public function getPot(){
    	return $this->rewardService->countRewardType(15);
    }

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'lotofootv2';
    }
}
<commit_msg>Correction Cagnoute<commit_after><?php

namespace Lotofootv2\Bundle\Twig\Extension;

use Lotofootv2\Bundle\Service\RewardService;

use Symfony\Component\Security\Core\SecurityContext;
use Doctrine\ORM\EntityManager;


class Lotofootv2Extensions extends \Twig_Extension
{
	protected $rewardService;

    public function __construct(RewardService $rewardService)
    {
        $this->rewardService = $rewardService;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getFunctions()
    {
        return array(
            'rewards' => new \Twig_Function_Method($this, 'getRewards', array('is_safe' => array('html'))),
          	'pot' => new \Twig_Function_Method($this, 'getPot', array('is_safe' => array('html'))),
            'reqKeyOrDefault' => new \Twig_Function_Method($this, 'reqKeyOrDefault', array('is_safe' => array('html'))),
        );
    }
    
    public function getRewards($accountId){
    	return $this->rewardService->getAccountRewards($accountId);
    }
    
    public function reqKeyOrDefault($request, $key, $default){
    	if($request->request->has($key)){
    		return $request->request->get($key);
    	}
        return $default;
    }
    
	public function getPot(){
    	return $this->rewardService->countRewardType(10);
    }

    /**
     * Returns the name of the extension.
     *
     * @return string The extension name
     */
    public function getName()
    {
        return 'lotofootv2';
    }
}

{'fraction_non_alphanumeric': 0.13604972375690608, 'fraction_numerical': 0.004143646408839779, 'mean_word_length': 2.9793956043956045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '3021129', 'n_tokens_mistral': 919, 'n_tokens_neox': 900, 'n_words': 163}