<commit_before><?php

namespace AppBundle\Controller\Handler;

use Symfony\Component\HttpFoundation\Response;

class HttpCacheResponseHandler implements ResponseHandler
{
    private $duration;
    
    public function __construct()
    {
        $this->setDuration(300);
    }
    
    /**
     * Update a valid non cacheable Response with http cache headers
     *
     * @see http://symfony.com/fr/doc/current/book/http_cache.html
     */
    public function handleResponse(Response $response)
    {
        // do not handle invalid response
        if (! $response->isOk()) {
            return $response;<commit_msg>use a constant<commit_after><?php

namespace AppBundle\Controller\Handler;

use Symfony\Component\HttpFoundation\Response;

class HttpCacheResponseHandler implements ResponseHandler
{
    const
        DEFAULT_DURATION = 300;
    
    private $duration;
    
    public function __construct()
    {
        $this->setDuration(self::DEFAULT_DURATION);
    }
    
    /**
     * Update a valid non cacheable Response with http cache headers
     *
     * @see http://symfony.com/fr/doc/current/book/http_cache.html
     */
    public function handleResponse(Response $response)
    {
        // do not handle invalid response
        if (! $response->isOk()) {
            return $response;
{'fraction_non_alphanumeric': 0.0962566844919786, 'fraction_numerical': 0.004583651642475172, 'mean_word_length': 2.638888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2141427', 'n_tokens_mistral': 357, 'n_tokens_neox': 352, 'n_words': 84}