<commit_before><?php

namespace Laravolt\Avatar;

use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

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

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('avatar', function (Application $app) {
            $cache = $app->make('cache.store');
            $config = $app['config']->get('laravolt.avatar');

            $avatar = new Avatar($config, $cache);
            $avatar->setGenerator($app['avatar.generator']);

            return $avatar;
        });

        $this->app->bind('avatar.generator', function (Application $app) {
            $config = $app->make('config');
            $class = $config->get('laravolt.avatar.generator');

            return new $class;
        });
    }<commit_msg>handle null config<commit_after><?php

namespace Laravolt\Avatar;

use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

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

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('avatar', function (Application $app) {
            $cache = $app->make('cache.store');
            $config = $app['config']->get('laravolt.avatar', []);

            $avatar = new Avatar($config, $cache);
            $avatar->setGenerator($app['avatar.generator']);

            return $avatar;
        });

        $this->app->bind('avatar.generator', function (Application $app) {
            $config = $app->make('config');
            $class = $config->get('laravolt.avatar.generator');

            return new $class;
        });
    }
{'fraction_non_alphanumeric': 0.14327343370568238, 'fraction_numerical': 0.0, 'mean_word_length': 2.311897106109325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '1842832', 'n_tokens_mistral': 575, 'n_tokens_neox': 571, 'n_words': 124}