<commit_before><?php
/**
 * Created by IntelliJ IDEA.
 * User: yuri.blanc
 * Date: 15/12/2016
 * Time: 15:50
 */

namespace yuxblank\phackp\core;


use yuxblank\phackp\api\Service;
use yuxblank\phackp\services\api\ServiceConfig;
use yuxblank\phackp\services\exceptions\ServiceProviderException;

class ServiceProvider implements Service
{
    protected $reflectionClass;
    protected $serviceConfig;

    public function __construct()
    {
        $this->reflectionClass = new \ReflectionClass($this);
    }

    /**
     * Set ServiceConfig impl. as default serviceConfig.
     * If ServiceConfig->isValid() is false, throw ServiceProviderException
     * @param ServiceConfig $config
     * @throws ServiceProviderException
     */
    public function config(ServiceConfig $config)
    {
        if (!$config->isValid()){
            throw new ServiceProviderException('The configuration is not valid for service '<commit_msg>Namespace error (grr. intellij!)<commit_after><?php
/**
 * Created by IntelliJ IDEA.
 * User: yuri.blanc
 * Date: 15/12/2016
 * Time: 15:50
 */

namespace yuxblank\phackp\core;



use yuxblank\phackp\services\api\Service;
use yuxblank\phackp\services\api\ServiceConfig;
use yuxblank\phackp\services\exceptions\ServiceProviderException;

class ServiceProvider implements Service
{
    protected $reflectionClass;
    protected $serviceConfig;

    public function __construct()
    {
        $this->reflectionClass = new \ReflectionClass($this);
    }

    /**
     * Set ServiceConfig impl. as default serviceConfig.
     * If ServiceConfig->isValid() is false, throw ServiceProviderException
     * @param ServiceConfig $config
     * @throws ServiceProviderException
     */
    public function config(ServiceConfig $config)
    {
        if (!$config->isValid()){
            throw new ServiceProviderException('The configuration is not valid for service '
{'fraction_non_alphanumeric': 0.10005293806246691, 'fraction_numerical': 0.01270513499205929, 'mean_word_length': 3.5323741007194243, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2119850', 'n_tokens_mistral': 550, 'n_tokens_neox': 530, 'n_words': 133}