<commit_before><?php

namespace m4grio\BangkokInsurance\Laravel\Providers;

use Illuminate\Support\ServiceProvider;
use m4grio\BangkokInsurance\ClientBuilder;
use m4grio\BangkokInsurance\Process\ModelProcess;
use m4grio\BangkokInsurance\Process\PremiumProcess;


/**
 * Bangkok Insurance Service Provider
 *
 * @package m4grio\BangkokInsurance\Laravel\Providers
 * @author  <NAME> <<EMAIL>>
 */
class BangkokInsuranceServiceProvider extends ServiceProvider
{
    /**
     * Deferred load
     *
     * @var bool
     */
    protected $defer = true;

    const BUILDER = 'bangkokinsurance-builder';
    const PREMIUM = 'bangkokinsurance-premium';
    const MODEL   = 'bangkokinsurance-model';
    const CONFIG  = 'bangkokinsurance';

    /**
     * Prepares a builder using the most generic configs
     *
     * @return ClientBuilder
     */
    public function register()
    {
        $this->app->bind(self::BUILDER, function ($app) {
            $config = $app['config'][self::CONFIG];

            $builder = (new ClientBuilder)->setEndpoint($config['endpoint'])
                ->setUserId($config['userid'])
                // @todo
                //->setLog(\Illuminate\Support\Facades\Log::getMonolog())
            ;

            return $builder;
        });

        $this->app->singleton(self::PREMIUM, function ($app) {
            /** @var ClientBuilder $builder */
            $builder = $app->make(self::BUILDER);
            $client = $builder->setProcess(new PremiumProcess)
                ->build()
            ;

            return $client;
        });

        $this->app->singleton(self::MODEL, function ($app) {
            /** @var ClientBuilder $builder */
            $builder = $app->make(self::BUILDER);
            $client = $builder->setProcess(new ModelProcess)
                ->build()
            ;

            return $client;
        });
    }

    /**
     * @return array
     */
    public function provides()
    {
        return [
            self::BUILDER,
            self::PREMIUM,
            self::MODEL,
        ];
    }
}<commit_msg>Builders registered in different methods to facilitate overwrite<commit_after><?php

namespace m4grio\BangkokInsurance\Laravel\Providers;

use Illuminate\Support\ServiceProvider;
use m4grio\BangkokInsurance\ClientBuilder;
use m4grio\BangkokInsurance\Process\ModelProcess;
use m4grio\BangkokInsurance\Process\PremiumProcess;


/**
 * Bangkok Insurance Service Provider
 *
 * @package m4grio\BangkokInsurance\Laravel\Providers
 * @author  <NAME> <<EMAIL>>
 */
class BangkokInsuranceServiceProvider extends ServiceProvider
{
    /**
     * Deferred load
     *
     * @var bool
     */
    protected $defer = true;

    const BUILDER = 'bangkokinsurance-builder';
    const PREMIUM = 'bangkokinsurance-premium';
    const MODEL   = 'bangkokinsurance-model';
    const CONFIG  = 'bangkokinsurance';

    /**
     * Prepares a builder using the most generic configs
     *
     * @return ClientBuilder
     */
    public function register()
    {
        $this->registerBuilder();
        $this->registerPremiumBuilder();
        $this->registerModelBuilder();
    }

    /**
     * Register general builder
     *
     * @return void
     */
    protected function registerBuilder()
    {
        $this->app->bind(self::BUILDER, function ($app) {
            $config = $app['config'][self::CONFIG];

            $builder = (new ClientBuilder)->setEndpoint($config['endpoint'])
                ->setUserId($config['userid'])
                // @todo
                //->setLog(\Illuminate\Support\Facades\Log::getMonolog())
            ;

            return $builder;
        });
    }

    /**
     * Register Premium Client builder
     */
    protected function registerPremiumBuilder()
    {
        $this->app->singleton(self::PREMIUM, function ($app) {
            /** @var ClientBuilder $builder */
            $builder = $app->make(self::BUILDER);
            $client = $builder->setProcess(new PremiumProcess)
                ->build()
            ;

            return $client;
        });
    }

    /**
     * Register Model Client builder
     */
    protected function registerModelBuilder()
    {
        $this->app->singleton(self::MODEL, function ($app) {
            /** @var ClientBuilder $builder */
            $builder = $app->make(self::BUILDER);
            $client = $builder->setProcess(new ModelProcess)
                ->build()
            ;

            return $client;
        });
    }

    /**
     * @return array
     */
    public function provides()
    {
        return [
            self::BUILDER,
            self::PREMIUM,
            self::MODEL,
        ];
    }
}
{'fraction_non_alphanumeric': 0.12873612297181897, 'fraction_numerical': 0.002134927412467976, 'mean_word_length': 2.0304010349288486, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 42, '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': '2006559', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1325, 'n_words': 244}