<commit_before><?php

namespace Nam\Commander\Events;

use Illuminate\Events\Dispatcher;

/**
 * Class DispatchableTrait
 *
 * @author  <NAME> <<EMAIL>>
 * @package Nam\Commander\Events
 *
 */
trait DispatchableTrait
{
    /**
     * @var Dispatcher
     */
    protected $dispatcher;

    /**
     * @return Dispatcher
     */
    public function getDispatcher()
    {
        if (! $this->dispatcher instanceof Dispatcher) {
            $this->dispatcher = \App::make('Nam\Commander\Events\EventDispatcher');
        }

        return $this->dispatcher;
    }

    /**
     * @param Dispatcher $dispatcher
     */
    public function setDispatcher(Dispatcher $dispatcher)
    {
        $this->dispatcher = $dispatcher;
    }
}<commit_msg>Add dispatch helper to DispatchableTrait<commit_after><?php

namespace Nam\Commander\Events;

use Illuminate\Events\Dispatcher;

/**
 * Class DispatchableTrait
 *
 * @author  <NAME> <<EMAIL>>
 * @package Nam\Commander\Events
 *
 */
trait DispatchableTrait
{
    /**
     * @var Dispatcher
     */
    protected $dispatcher;

    /**
     * @return Dispatcher
     */
    public function getDispatcher()
    {
        if (! $this->dispatcher instanceof Dispatcher) {
            $this->dispatcher = \App::make('Nam\Commander\Events\EventDispatcher');
        }

        return $this->dispatcher;
    }

    /**
     * @param Dispatcher $dispatcher
     */
    public function setDispatcher(Dispatcher $dispatcher)
    {
        $this->dispatcher = $dispatcher;
    }

    public function dispatch()
    {
        $this->getDispatcher()->dispatch($this->releaseEvents());
    }
}
{'fraction_non_alphanumeric': 0.1341991341991342, 'fraction_numerical': 0.0, 'mean_word_length': 2.479569892473118, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, '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': '7581179', 'n_tokens_mistral': 502, 'n_tokens_neox': 482, 'n_words': 88}