<commit_before><?php

namespace League\Event;

trait EmitterTrait
{
    protected $emitter;

    public function setEmitter(Emitter $emitter)
    {
        $this->emitter = $emitter;

        return $this;
    }

    public function getEmitter()
    {
        if ( ! $this->emitter) {
            $this->emitter = new Emitter;
        }

        return $this->emitter;
    }

    public function addListener($event, $listener)
    {
        call_user_func_array([$this->emitter, 'addListener'], func_get_args());

        return $this;
    }

    public function addOneTimeListener($event, $listener)
    {
        call_user_func_array([$this->emitter, 'addOneTimeListener'], func_get_args());

        return $this;
    }

    public function removeListener($event, $listener)
    {
        $emitter = $this->getEmitter();

        call_user_func_array([$emitter, 'removeListener'], func_get_args());

        return $this;
    }

    public function removeAllListeners($event)
    {<commit_msg>Use getEmitter within the EmitterTrait<commit_after><?php

namespace League\Event;

trait EmitterTrait
{
    protected $emitter;

    public function setEmitter(Emitter $emitter)
    {
        $this->emitter = $emitter;

        return $this;
    }

    public function getEmitter()
    {
        if ( ! $this->emitter) {
            $this->emitter = new Emitter;
        }

        return $this->emitter;
    }

    public function addListener($event, $listener)
    {
        $emitter = $this->getEmitter();

        call_user_func_array([$emitter, 'addListener'], func_get_args());

        return $this;
    }

    public function addOneTimeListener($event, $listener)
    {
        $emitter = $this->getEmitter();

        call_user_func_array([$emitter, 'addOneTimeListener'], func_get_args());

        return $this;
    }

    public function removeListener($event, $listener)
    {
        $emitter = $this->getEmitter();

        call_user_func_array([$emitter, 'removeListener'], func_get_args());

        return $this;
    }

    public function removeAllListeners($event)
    {
{'fraction_non_alphanumeric': 0.12362242453282224, 'fraction_numerical': 0.0, 'mean_word_length': 2.5814751286449398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '6498744', 'n_tokens_mistral': 648, 'n_tokens_neox': 609, 'n_words': 122}