<commit_before><?php
/**
 * Class Event
 */
trait Event
{
    /**
     * event => ['action']
     * @var array
     */
    public $eventListener = [];

    /**
     * @param string $name
     * @param $context
     */
    public function event($name = '', $context)
    {
        $this->say('Rised event "' . $name . '"');

        if(isset($this->eventListener[$name]))
        {
            foreach($this->eventListener[$name] as $listener)
            {
                if(method_exists($this, $listener))
                    $this->$listener($context);
            }
        }
    }

    /**
     * @param string $event
     * @param string $listener
     */
    public function listen($event = '', $listener = '')
    {
        if(!isset($this->eventListener[$event]))
            $this->eventListener[$event] = [];

        $this->eventListener[$event][] = $listener;
    }
}<commit_msg>Update Event.php<commit_after><?php
/**
 * Class Event
 */
trait Event
{
    /**
     * event => ['action']
     * @var array
     */
    public $eventListener = [];

    /**
     * @param string $name
     * @param mixed $context
     * @return $this
     */
    public function event($name = '', $context = null)
    {
        $this->say('Rised event "' . $name . '"');

        if(isset($this->eventListener[$name]))
        {
            foreach($this->eventListener[$name] as $listener)
            {
                if(method_exists($this, $listener))
                    $this->$listener($context);
            }
        }

        return $this;
    }

    /**
     * @param string $event
     * @param string $listener
     * @return $this
     */
    public function listen($event = '', $listener = '')
    {
        if(!isset($this->eventListener[$event]))
            $this->eventListener[$event] = [];

        $this->eventListener[$event][] = $listener;

        return $this;
    }
}
{'fraction_non_alphanumeric': 0.17777777777777778, 'fraction_numerical': 0.0, 'mean_word_length': 1.7326589595375723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '2049309', 'n_tokens_mistral': 551, 'n_tokens_neox': 539, 'n_words': 99}