<commit_before><?php

namespace ZF2EntityAudit;

use Zend\Mvc\MvcEvent;
use SimpleThings\EntityAudit\AuditConfiguration;
use SimpleThings\EntityAudit\AuditManager;
use SimpleThings\EntityAudit\EventListener\CreateSchemaListener;
use SimpleThings\EntityAudit\EventListener\LogRevisionsListener;

class Module {

    public function getAutoloaderConfig() {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function onBootstrap(MvcEvent $e) {
        $sm = $e->getApplication()->getServiceManager();
        $auditManager = $sm->get("auditManager");
    }

    public function getConfig() {
        return include'config/module.config.php';
    }

    public function getServiceConfig() {
        return array(
            'factories' => array(
                "auditManager" => function ($sm) {
                    $config = $sm->get("Config");
                    $evm = $sm->get("doctrine.eventmanager.orm_default");

                    $auditconfig = new AuditConfiguration();
                    $auditconfig->setAuditedEntityClasses($config["audited_entities"]);
                    if ($config["zfcuser.integration"] === true) {
                        $auth = $sm->get('zfcuser_auth_service');
                        if ($auth->hasIdentity()) {
                            $identity = $auth->getIdentity();
                            $auditconfig->setCurrentUsername($identity->getEmail());
                        } else {
                            $auditconfig->setCurrentUsername("Anonymous");
                        }
                    } else {
                        $auditconfig->setCurrentUsername("Anonymous");
                    }
                    $auditManager = new AuditManager($auditconfig);
                    $evm->addEventSubscriber(new CreateSchemaListener($auditManager));
                    $evm->addEventSubscriber(new LogRevisionsListener($auditManager));
                    return $auditManager;
                },<commit_msg>updating module.php to have auditConfig key<commit_after><?php

namespace ZF2EntityAudit;

use Zend\Mvc\MvcEvent;
use SimpleThings\EntityAudit\AuditConfiguration;
use SimpleThings\EntityAudit\AuditManager;
use SimpleThings\EntityAudit\EventListener\CreateSchemaListener;
use SimpleThings\EntityAudit\EventListener\LogRevisionsListener;

class Module {

    public function getAutoloaderConfig() {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function onBootstrap(MvcEvent $e) {
        $sm = $e->getApplication()->getServiceManager();
        $auditManager = $sm->get("auditManager");
    }

    public function getConfig() {
        return include'config/module.config.php';
    }

    public function getServiceConfig() {
        return array(
            'factories' => array(
                "auditConfig"  => function($sm){
                    $config = $sm->get("Config");
                    $auditconfig = new AuditConfiguration();
                    $auditconfig->setAuditedEntityClasses($config["audited_entities"]);
                    return $auditconfig;
                },
                "auditManager" => function ($sm) {
                    $config = $sm->get("Config");
                    $evm = $sm->get("doctrine.eventmanager.orm_default");
                    
                    $auditconfig = $sm->get("auditConfig");
                    
                    if ($config["zfcuser.integration"] === true) {
                        $auth = $sm->get('zfcuser_auth_service');
                        if ($auth->hasIdentity()) {
                            $identity = $auth->getIdentity();
                            $auditconfig->setCurrentUsername($identity->getEmail());
                        } else {
                            $auditconfig->setCurrentUsername("Anonymous");
                        }
                    } else {
                        $auditconfig->setCurrentUsername("Anonymous");
                    }
                    $auditManager = new AuditManager($auditconfig);
                    $evm->addEventSubscriber(new CreateSchemaListener($auditManager));
                    $evm->addEventSubscriber(new LogRevisionsListener($auditManager));
                    return $auditManager;
                },
{'fraction_non_alphanumeric': 0.11423297785069729, 'fraction_numerical': 0.00041017227235438887, 'mean_word_length': 1.666484417714598, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, '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': '6105826', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1199, 'n_words': 185}