<commit_before><?php
namespace UpCloo\App;

use Zend\ServiceManager\ServiceManager;
use Zend\EventManager\EventManager;
use Zend\ServiceManager\Config as ServiceManagerConfig;

class Boot
{
    private $conf;

    private $serviceManager;
    private $eventManager;

    public function __construct(Config\Mergeable $config)
    {
        $this->conf = $config;
    }

    public function setServiceManager($serviceManager)
    {
        $this->serviceManager = $serviceManager;
    }

    public function services()
    {
        if (!$this->serviceManager) {
            $this->serviceManager = new ServiceManager();
        }

        return $this->serviceManager;
    }

    public function setEventManager($eventManager)
    {
        $this->eventManager = $eventManager;
    }

    public function events()
    {
        if (!$this->eventManager) {
            $this->eventManager = new EventManager();
        }

        return $this->eventManager;
    }

    public function bootstrap()
    {
        $this->conf->prependConfig($this->getBaseConfiguration());
        $this->conf = $this->conf->merge();

        $this->registerServices();
        $this->registerListenersFromServices();

        return $this;
    }

    private function registerServices()
    {
        $serviceManager = $this->services();

        $serviceConfig = new ServiceManagerConfig($this->conf["services"]);
        $serviceConfig->configureServiceManager($serviceManager);

        $serviceManager->setService("Config", $this->conf);
    }

    private function registerListenersFromServices()
    {
        foreach ($this->conf["listeners"] as $eventName => $callables) {
            $this->registerCallbacks($eventName, $callables);
        }
    }
<commit_msg>No single boot operation<commit_after><?php
namespace UpCloo\App;

use Zend\ServiceManager\ServiceManager;
use Zend\EventManager\EventManager;
use Zend\ServiceManager\Config as ServiceManagerConfig;

class Boot
{
    private $conf;

    private $serviceManager;
    private $eventManager;

    public function __construct(Config\Mergeable $config)
    {
        $this->conf = $config;
    }

    public function setServiceManager($serviceManager)
    {
        $this->serviceManager = $serviceManager;
    }

    public function services()
    {
        if (!$this->serviceManager) {
            $this->serviceManager = new ServiceManager();
        }

        return $this->serviceManager;
    }

    public function setEventManager($eventManager)
    {
        $this->eventManager = $eventManager;
    }

    public function events()
    {
        if (!$this->eventManager) {
            $this->eventManager = new EventManager();
        }

        return $this->eventManager;
    }

    public function bootstrap()
    {
        $conf = $this->conf;
        $conf->prependConfig($this->getBaseConfiguration());

        $this->registerServices($conf->merge());
        $this->registerListenersFromServices();

        return $this;
    }

    private function registerServices($conf)
    {
        $serviceManager = $this->services();

        $serviceConfig = new ServiceManagerConfig($conf["services"]);
        $serviceConfig->configureServiceManager($serviceManager);

        $serviceManager->setService("Config", $conf);
    }

    private function registerListenersFromServices()
    {
        foreach ($this->services()->get("Config")["listeners"] as $eventName => $callables) {
            $this->registerCallbacks($eventName, $callables);
        }
    }

{'fraction_non_alphanumeric': 0.12393405343945424, 'fraction_numerical': 0.0, 'mean_word_length': 2.731707317073171, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 50, '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': '5413692', 'n_tokens_mistral': 947, 'n_tokens_neox': 916, 'n_words': 175}