<commit_before><?php

namespace Pipe;

use Symfony\Component\Yaml\Yaml;

class Config extends \ArrayObject
{
    # Maps compressor names (available as js_compressor/css_compressor) 
    # to template classes.
    var $compressors = array(
        "uglify_js" => "\\Pipe\\Compressor\\UglifyJs"
    );

    var $jsCompression = true;
    var $cssCompression = true;

    # Public: Creates a config object from the YAML file/string.
    #
    # Returns a new Config object.
    static function fromYaml($yaml)
    {
        $config = Yaml::parse($yaml);
        return new static($config);
    }

    function createEnvironment()
    {
        $env = new Environment;

        $loadPaths = $this['load_paths'] ?: array();
        $env->appendPath($loadPaths);

        if ($this->jsCompression and $jsCompressor = $this['js_compressor']) {
            if ($compressor = @$this->compressors[$jsCompressor]) {
                $env->registerBundleProcessor('application/javascript', $compressor);
            } else {
                throw new \UnexpectedValueException("JS compressor '$jsCompressor' not found.");
            }
        }

        if ($this->cssCompression and $cssCompressor = $this["css_compressor"]) {
            if ($compressor = @$this->compressors[$cssCompressor]) {
                $env->registerBundleProcessor('text/css', $compressor);
            } else {
                throw new \UnexpectedValueException("CSS compressor '$cssCompressor' not found.");
            }
        }

        return $env;
    }

    function offsetGet($key)
    {
        if (isset($this[$key])) {
            return parent::offsetGet($key);
        }
    }
}<commit_msg>Removed jsCompression and cssCompression flags. Just set either js_compressor or css_compressor.<commit_after><?php

namespace Pipe;

use Symfony\Component\Yaml\Yaml;

class Config extends \ArrayObject
{
    # Maps compressor names (available as js_compressor/css_compressor) 
    # to template classes.
    var $compressors = array(
        "uglify_js" => "\\Pipe\\Compressor\\UglifyJs"
    );

    # Public: Creates a config object from the YAML file/string.
    #
    # Returns a new Config object.
    static function fromYaml($yaml)
    {
        $config = Yaml::parse($yaml);
        return new static($config);
    }

    # Creates an environment from the config keys.
    #
    # Returns a new Environment instance.
    function createEnvironment()
    {
        $env = new Environment;

        $loadPaths = $this['load_paths'] ?: array();
        $env->appendPath($loadPaths);

        if ($jsCompressor = $this['js_compressor']) {
            if ($compressor = @$this->compressors[$jsCompressor]) {
                $env->registerBundleProcessor('application/javascript', $compressor);
            } else {
                throw new \UnexpectedValueException("JS compressor '$jsCompressor' not found.");
            }
        }

        if ($cssCompressor = $this["css_compressor"]) {
            if ($compressor = @$this->compressors[$cssCompressor]) {
                $env->registerBundleProcessor('text/css', $compressor);
            } else {
                throw new \UnexpectedValueException("CSS compressor '$cssCompressor' not found.");
            }
        }

        return $env;
    }

    # Retrieves a config key. Makes no notices if the key
    # does not exist.
    #
    # key - The config key to return.
    #
    # Returns the config value or null.
    function offsetGet($key)
    {
        if (isset($this[$key])) {
            return parent::offsetGet($key);
        }
    }
}
{'fraction_non_alphanumeric': 0.12175370008377548, 'fraction_numerical': 0.0, 'mean_word_length': 2.2742230347349177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '875423', 'n_tokens_mistral': 1031, 'n_tokens_neox': 978, 'n_words': 245}