<commit_before><?php
/**
 * Config Provider
 *
 * Register the correct config handler based on the container property
 * 'configHandler', and the Config service itself.
 *
 * @package   SlaxWeb\Config
 * @author    <NAME> <<EMAIL>>
 * @copyright 2016 (c) <NAME>
 * @license   MIT <https://opensource.org/licenses/MIT>
 * @link      https://github.com/slaxweb/
 * @version   0.1
 */
namespace SlaxWeb\Config\Service;

use Pimple\Container;

class ConfigProvider implements \Pimple\ServiceProviderInterface
{
    /**
     * Register provider
     *
     * Register is called by the container, when the provider gets registered.
     *
     * @param \Pimple\Container $container Dependency Injection Container
     * @return void
     */
    public function register(Container $container)
    {
        $container["config.service"] = function (Container $cont) {
            return new \SlaxWeb\Config\Config(
                $cont["configHandler"],
                $cont["configResourceLocation"]
            );
        };

        $container["configHandler.service"] = function (Container $cont) {
            switch ($cont["configHandler"]) {
                case "php":
                    return new PhpConfigHandler;
                    break;
                case "xml":
                    $xml = new \Desperado\XmlBundle\Model\XmlReader;
                    return new XmlConfigHandler($xml);
                    break;
                case "yaml":
                    return new YamlConfigHandler;
                    break;
                default:
                    throw new Exception\InvalidHandlerTypeException(
                        "Handler type property 'configHandler' must be one of "
                        . "['php', 'xml', 'yaml']"
                    );
            }
        };
    }
}<commit_msg>final fixes for the config provider<commit_after><?php
/**
 * Config Provider
 *
 * Register the correct config handler based on the container property
 * 'configHandler', and the Config service itself.
 *
 * @package   SlaxWeb\Config
 * @author    <NAME> <<EMAIL>>
 * @copyright 2016 (c) <NAME>
 * @license   MIT <https://opensource.org/licenses/MIT>
 * @link      https://github.com/slaxweb/
 * @version   0.1
 */
namespace SlaxWeb\Config\Service;

use Pimple\Container;

class ConfigProvider implements \Pimple\ServiceProviderInterface
{
    /**
     * Register provider
     *
     * Register is called by the container, when the provider gets registered.
     *
     * @param \Pimple\Container $container Dependency Injection Container
     * @return void
     */
    public function register(Container $container)
    {
        $container["config.service"] = function (Container $cont) {
            return new \SlaxWeb\Config\Config(
                $cont["configHandler.service"],
                $cont["configResourceLocation"]
            );
        };

        $container["configHandler.service"] = function (Container $cont) {
            switch ($cont["configHandler"]) {
                case "php":
                    return new \SlaxWeb\Config\PhpConfigHandler;
                    break;
                case "xml":
                    $xml = new \Desperado\XmlBundle\Model\XmlReader;
                    return new \SlaxWeb\Config\XmlConfigHandler($xml);
                    break;
                case "yaml":
                    return new \SlaxWeb\Config\YamlConfigHandler;
                    break;
                default:
                    throw new \SlaxWeb\Config\Exception\InvalidHandlerTypeException(
                        "Handler type property 'configHandler' must be one of "
                        . "['php', 'xml', 'yaml']"
                    );
            }
        };
    }
}
{'fraction_non_alphanumeric': 0.103955104222341, 'fraction_numerical': 0.003206841261357563, 'mean_word_length': 1.7301239970824216, 'pattern_counts': {'":': 6, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2244471', 'n_tokens_mistral': 966, 'n_tokens_neox': 910, 'n_words': 243}