<commit_before><?php

namespace Madewithlove\LaravelCqrsEs\EventStore;

use Broadway\EventStore\EventStoreInterface;
use Broadway\EventStore\Management\EventStoreManagementInterface;
use Madewithlove\LaravelCqrsEs\EventStore\Console\Replay;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
    /**
     * @var bool
     */
    protected $defer = true;

    /**
     * @return null
     */
    public function register()
    {
        $this->commands([
            Replay::class,
        ]);

        $this->app->singleton('event_store.driver', function () {
            return (new EventStoreManager($this->app))->driver();
        });

        $this->app->alias(EventStoreInterface::class, 'event_store.driver');
        $this->app->alias(EventStoreManagementInterface::class, 'event_store.driver');
    }

    /**
     * @return array
     */
    public function provides()
    {
        return [
            EventStoreManagementInterface::class,
            EventStoreInterface::class,
        ];
    }
}<commit_msg>binding eventbus and eveentdispatcher<commit_after><?php

namespace Madewithlove\LaravelCqrsEs\EventStore;

use Broadway\EventDispatcher\EventDispatcher;
use Broadway\EventDispatcher\EventDispatcherInterface;
use Broadway\EventHandling\EventBusInterface;
use Broadway\EventHandling\SimpleEventBus;
use Broadway\EventStore\EventStoreInterface;
use Broadway\EventStore\Management\EventStoreManagementInterface;
use Madewithlove\LaravelCqrsEs\EventStore\Console\Replay;

class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
    /**
     * @var bool
     */
    protected $defer = true;

    /**
     * @return null
     */
    public function register()
    {
        $this->commands([
            Replay::class,
        ]);

        $this->app->singleton('event_store.driver', function () {
            return (new EventStoreManager($this->app))->driver();
        });

        $this->app->singleton(EventDispatcherInterface::class, function () {
            return new EventDispatcher();
        });
        $this->app->singleton(EventBusInterface::class, function () {
            return new SimpleEventBus();
        });

        $this->app->alias(EventStoreInterface::class, 'event_store.driver');
        $this->app->alias(EventStoreManagementInterface::class, 'event_store.driver');
    }

    /**
     * @return array
     */
    public function provides()
    {
        return [
            EventStoreManagementInterface::class,
            EventStoreInterface::class,
        ];
    }
}
{'fraction_non_alphanumeric': 0.12328229289360032, 'fraction_numerical': 0.0, 'mean_word_length': 2.831578947368421, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '5812303', 'n_tokens_mistral': 696, 'n_tokens_neox': 680, 'n_words': 105}