<commit_before><?php

/*
 * This file is part of Mannequin.
 *
 * (c) 2017 Last Call Media, <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace LastCall\Mannequin\Twig\Subscriber;

use LastCall\Mannequin\Core\Event\PatternDiscoveryEvent;
use LastCall\Mannequin\Core\Event\PatternEvents;
use LastCall\Mannequin\Twig\Pattern\TwigPattern;
use LastCall\Mannequin\Twig\TwigInspectorInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class TwigIncludeSubscriber implements EventSubscriberInterface
{
    private $inspector;

    private $prefix;

    public function __construct(
        TwigInspectorInterface $inspector,
        string $prefix = 'twig'
    ) {
        $this->inspector = $inspector;
        $this->prefix = $prefix;
    }

    public static function getSubscribedEvents()
    {
        return [
            PatternEvents::DISCOVER => 'detect',
        ];
    }

    public function detect(PatternDiscoveryEvent $event)
    {<commit_msg>Remove extraneous 'prefix' variable<commit_after><?php

/*
 * This file is part of Mannequin.
 *
 * (c) 2017 Last Call Media, <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace LastCall\Mannequin\Twig\Subscriber;

use LastCall\Mannequin\Core\Event\PatternDiscoveryEvent;
use LastCall\Mannequin\Core\Event\PatternEvents;
use LastCall\Mannequin\Twig\Pattern\TwigPattern;
use LastCall\Mannequin\Twig\TwigInspectorInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class TwigIncludeSubscriber implements EventSubscriberInterface
{
    private $inspector;

    public function __construct(
        TwigInspectorInterface $inspector
    ) {
        $this->inspector = $inspector;
    }

    public static function getSubscribedEvents()
    {
        return [
            PatternEvents::DISCOVER => 'detect',
        ];
    }

    public function detect(PatternDiscoveryEvent $event)
    {
{'fraction_non_alphanumeric': 0.08928571428571429, 'fraction_numerical': 0.003861003861003861, 'mean_word_length': 3.5964523281596454, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '2393051', 'n_tokens_mistral': 625, 'n_tokens_neox': 599, 'n_words': 150}