<commit_before><?php namespace Nwidart\LaravelForecast;

use Forecast\Forecast;
use Illuminate\Support\ServiceProvider;

class LaravelForecastServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->registerConfiguration();

        $this->app->singleton(\Forecast\Forecast::class, function ($app) {
            return new Forecast($app['config']->get('laravel-forecast.API_KEY'));
        });
    }

    /**
     * Register the configuration file so Laravel can publish them
     * Also merges the published config file with original
     */
    private function registerConfiguration()
    {
        $configPath = __DIR__ . '/../config/laravel-forecast.php';<commit_msg>Adding possibility to append options on the request<commit_after><?php namespace Nwidart\LaravelForecast;

use Illuminate\Support\ServiceProvider;
use Nwidart\ForecastPhp\Forecast;

class LaravelForecastServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->registerConfiguration();

        $this->app->singleton(Forecast::class, function () {
            $forecast = new Forecast(config('laravel-forecast.API_KEY'));

            if (! empty(config('laravel-forecast.options'))) {
                $forecast->setOptions(config('laravel-forecast.options'));
            }

            return $forecast;
        });
    }

    /**
     * Register the configuration file so Laravel can publish them
     * Also merges the published config file with original
     */
    private function registerConfiguration()
    {
        $configPath = __DIR__ . '/../config/laravel-forecast.php';
{'fraction_non_alphanumeric': 0.11040547142159257, 'fraction_numerical': 0.0, 'mean_word_length': 2.5310344827586206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4654450', 'n_tokens_mistral': 554, 'n_tokens_neox': 545, 'n_words': 136}