<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Michal
 * Date: 8.1.14
 * Time: 19:02
 */

namespace AnnotateCms\Themes\DI;


use AnnotateCms\Framework\DI\CompilerExtension;
use AnnotateCms\Themes\Loaders\ThemesLoader;
use Kdyby\Events\DI\EventsExtension;

class ThemesExtension extends CompilerExtension
{


    function getServices()
    {
        $config = $this->getConfig();
        return [
            "themeLoader" => [
                "class" => ThemesLoader::classname,
                "tags" => [EventsExtension::SUBSCRIBER_TAG],
                "setup" => [
                    "setFrontendTheme" => ["name" => $config["frontend"]],
                    "setBackendTheme" => ["name" => $config["backend"]],
                ],
            ],
        ];
    }


    function getFactories()
    {
        // TODO: Implement getFactories() method.
    }


    function  getDefaults()
    {
        return [
            "frontend" => "Sandbox",
            "backend" => "Flatty",
        ];
    }
}<commit_msg>Remove custom compiler extension class<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Michal
 * Date: 8.1.14
 * Time: 19:02
 */

namespace AnnotateCms\Themes\DI;


use AnnotateCms\Themes\Loaders\ThemesLoader;
use Kdyby\Events\DI\EventsExtension;
use Nette\DI\CompilerExtension;

class ThemesExtension extends CompilerExtension
{
    public function loadConfiguration()
    {
        $configuration = $this->getConfig($this->getDefaults());

        $this->getContainerBuilder()->addDefinition($this->prefix('themeLoader'))
            ->setClass(ThemesLoader::classname)
            ->addTag(EventsExtension::SUBSCRIBER_TAG)
            ->addSetup('setFrontendTheme', ['name' => $configuration['frontend']])
            ->addSetup('setBackendTheme', ['name' => $configuration['backend']]);
    }


    function  getDefaults()
    {
        return [
            'frontend' => '',
            'backend' => '',
        ];
    }
}
{'fraction_non_alphanumeric': 0.14584395716471188, 'fraction_numerical': 0.00815910249872514, 'mean_word_length': 2.336734693877551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '2821060', 'n_tokens_mistral': 610, 'n_tokens_neox': 583, 'n_words': 97}