<commit_before><?php

namespace Symfony\Framework\ProfilerBundle\DataCollector;

use Symfony\Components\DependencyInjection\ContainerInterface;

/*
 * This file is part of the Symfony framework.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
 * DataCollector.
 *
 * @package    Symfony
 * @subpackage Framework_ProfilerBundle
 * @author     <NAME> <<EMAIL>>
 */
abstract class DataCollector implements DataCollectorInterface
{
    protected $manager;
    protected $container;
    protected $data;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function getData()
    {
        if (null === $this->data)
        {
            $this->data = $this->collect();
        }

        return $this->data;
    }

    abstract protected function collect();

    public function setCollectorManager(DataCollectorManager $manager)
    {
        $this->manager = $manager;
    }
}<commit_msg>[ProfilerBundle] Added a way to manually set data for collectors<commit_after><?php

namespace Symfony\Framework\ProfilerBundle\DataCollector;

use Symfony\Components\DependencyInjection\ContainerInterface;

/*
 * This file is part of the Symfony framework.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
 * DataCollector.
 *
 * @package    Symfony
 * @subpackage Framework_ProfilerBundle
 * @author     <NAME> <<EMAIL>>
 */
abstract class DataCollector implements DataCollectorInterface
{
    protected $manager;
    protected $container;
    protected $data;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function getData()
    {
        if (null === $this->data)
        {
            $this->data = $this->collect();
        }

        return $this->data;
    }

    public function setData($data)
    {
		$this->data = $data;
    }

    abstract protected function collect();

    public function setCollectorManager(DataCollectorManager $manager)
    {
        $this->manager = $manager;
    }
}
{'fraction_non_alphanumeric': 0.10720640569395018, 'fraction_numerical': 0.0, 'mean_word_length': 2.9318181818181817, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 28, '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': '7660947', 'n_tokens_mistral': 637, 'n_tokens_neox': 623, 'n_words': 176}