<commit_before><?php

namespace Zend\Module\Listener;

use Zend\EventManager\StaticEventManager,
    Zend\EventManager\Event,
    Zend\Module\ModuleEvent,
    Zend\Module\Consumer\LocatorRegistered,
    Zend\EventManager\EventCollection,
    Zend\EventManager\ListenerAggregate;

class LocatorRegistrationListener extends AbstractListener implements ListenerAggregate
{
    /**
     * @var array
     */
    protected $modules = array();

    /**
     * @var array
     */
    protected $listeners = array();

    public function __invoke(ModuleEvent $e)
    {
        return $this->loadModule($e);
    }

    public function loadModule(ModuleEvent $e)
    {
        if (!$e->getModule() instanceof LocatorRegistered) {
            return;
        }
        $this->modules[] = $e->getModule();
        $events = StaticEventManager::getInstance();
        $events->attach('bootstrap', 'bootstrap', array($this, 'addTypePreference'), 1000);
    }

    public function loadModulesPost(Event $e)
    {
        if (0 === count($this->modules)) {
            return;
        }

        // Attach to the bootstrap event if there are modules we need to process
        $events = StaticEventManager::getInstance();<commit_msg>[Zend\Module] Remove extra bootstrap event listener attachement<commit_after><?php

namespace Zend\Module\Listener;

use Zend\EventManager\StaticEventManager,
    Zend\EventManager\Event,
    Zend\Module\ModuleEvent,
    Zend\Module\Consumer\LocatorRegistered,
    Zend\EventManager\EventCollection,
    Zend\EventManager\ListenerAggregate;

class LocatorRegistrationListener extends AbstractListener implements ListenerAggregate
{
    /**
     * @var array
     */
    protected $modules = array();

    /**
     * @var array
     */
    protected $listeners = array();

    public function __invoke(ModuleEvent $e)
    {
        return $this->loadModule($e);
    }

    public function loadModule(ModuleEvent $e)
    {
        if (!$e->getModule() instanceof LocatorRegistered) {
            return;
        }
        $this->modules[] = $e->getModule();
    }

    public function loadModulesPost(Event $e)
    {
        if (0 === count($this->modules)) {
            return;
        }

        // Attach to the bootstrap event if there are modules we need to process
        $events = StaticEventManager::getInstance();
{'fraction_non_alphanumeric': 0.11329628046173579, 'fraction_numerical': 0.0025651988029072254, 'mean_word_length': 2.7320574162679425, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6125431', 'n_tokens_mistral': 657, 'n_tokens_neox': 641, 'n_words': 144}