<commit_before><?php
/*
 * This file is part of the inlitteris project.
 *
 * (c) <NAME> <http://github.com/jobrunner/yii2-inlitteris>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace jobrunner\inlitteris;

use \yii\base\Module as BaseModule;
use yii\i18n\PhpMessageSource;

/**
 * This is the main module class for the yii2-inlitteris.
 *
 * @package jobrunner\inlitteris
 * @author <NAME> <<EMAIL>>
 */
class Module extends BaseModule
{
    public $controllerNamespace = 'jobrunner\inlitteris\controllers';

    public $controllerMap = [
        'references' => 'jobrunner\inlitteris\controllers\ReferenceController',
    ];

    public $modelMap = [
        'Reference'         => 'jobrunner\inlitteris\models\Referece',
        'ReferenceType'     => 'jobrunner\inlitteris\models\RefereceType',
        'ReferenceSetting'  => 'jobrunner\inlitteris\models\RefereceSetting',

    ];

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();

        $app = \Yii::$app;

        // register "inlitteris" namespace for translation messages
        if (!isset($app->get('i18n')->translations['inlitteris'])) {
            $app->get('i18n')->translations['inlitteris'] = [
                'class'    => PhpMessageSource::className(),
                'sourceLanguage' => 'en',
                'basePath' => __DIR__ . '/messages',
            ];
        }
    }
}<commit_msg>Module should prepare DI container.<commit_after><?php
/*
 * This file is part of the inlitteris project.
 *
 * (c) <NAME> <http://github.com/jobrunner/yii2-inlitteris>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace jobrunner\inlitteris;

use Yii;
use \yii\base\Module as BaseModule;
use yii\i18n\PhpMessageSource;

/**
 * This is the main module class for the yii2-inlitteris.
 *
 * @package jobrunner\inlitteris
 * @author <NAME> <<EMAIL>>
 */
class Module extends BaseModule
{
    public $controllerNamespace = 'jobrunner\inlitteris\controllers';

    protected $_controllerMap = [
        'references' => 'jobrunner\inlitteris\controllers\ReferenceController',
    ];

    /** @var array Model's map */
    protected $_modelMap = [
        'Reference'         => 'jobrunner\inlitteris\models\Reference',
        'ReferenceType'     => 'jobrunner\inlitteris\models\ReferenceType',
        'ReferenceSetting'  => 'jobrunner\inlitteris\models\ReferenceSetting',
    ];

    /** @var array Model map */
    public $modelMap = [];

    /** @var array Controller map */
    public $controllerMap = [];


    public $extensionMap = [
        'CiteProcessor'     => 'jobrunner\inlitteris\api\CiteProcessor'
    ];

    /** @var int Default reference type */
    public $defaultReferenceTypeId = 0;

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();

        $app = \Yii::$app;

        // register "inlitteris" namespace for translation messages
        if (!isset($app->get('i18n')->translations['inlitteris'])) {
            $app->get('i18n')->translations['inlitteris'] = [
                'class'    => PhpMessageSource::className(),
                'sourceLanguage' => 'en',
                'basePath' => __DIR__ . '/messages',
            ];
        }

        $this->modelMap = array_merge($this->_modelMap, $this->modelMap);

        foreach ($this->modelMap as $name => $class) {
            Yii::$container->set($name, $class);
        }

        foreach ($this->extensionMap as $name => $definition) {
            $class      = 'jobrunner\\inlitteris\api\\' . $name;
            $extName    = is_array($definition) ? $definition['class'] : $definition;

            Yii::$container->set($class, $definition);

            if ('CiteProcessor' == $name) {
                Yii::$container->set($name, function () use ($extName) {

                    return new $extName();
                });
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.143524207421971, 'fraction_numerical': 0.004177930695502581, 'mean_word_length': 2.455008488964346, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 46, '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': '4058981', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1197, 'n_words': 258}