<commit_before><?php 
class EventManager
{
    private $_listeners;
    
    public function subscribe($event, $listener)
    {
        if (!is_callable($listener)) {
            throw new RuntimeException("You must pass a callable!");
        }
        
        if (!isset($this->_listeners[$event])) {
            $this->_listeners[$event] = array();
        }
    
        $this->_listeners[$event][] = $listener;
    }
    
    public function publish($event, array $arguments = array())
    {
        foreach ($this->_listeners($event) as $listener) {
            call_user_func_array($listener, $arguments);
        }
    }
    
    protected function _listeners($event)
    {
        if (
            array_key_exists($event, $this->_listeners) && 
            $this->_listeners[$event]) {
            return $this->_listeners[$event];
        } else {
            return array();
        }
    }
    
    public function clear($event = null)
    {
        if ($event !== null) {
            unset($this->_listeners[$event]);
        } else {
            $this->_listeners = array();
        }
    }
}<commit_msg>Fix missing events<commit_after><?php 
class EventManager
{
    private $_listeners;
    
    public function subscribe($event, $listener)
    {
        if (!is_callable($listener)) {
            throw new RuntimeException("You must pass a callable!");
        }
        
        if (!isset($this->_listeners[$event])) {
            $this->_listeners[$event] = array();
        }
    
        $this->_listeners[$event][] = $listener;
    }
    
    public function publish($event, array $arguments = array())
    {
        foreach ($this->_listeners($event) as $listener) {
            call_user_func_array($listener, $arguments);
        }
    }
    
    protected function _listeners($event)
    {
        if (
            $this->_listeners[$event] &&
            array_key_exists($event, $this->_listeners)  
            ) {
            return $this->_listeners[$event];
        } else {
            return array();
        }
    }
    
    public function clear($event = null)
    {
        if ($event !== null) {
            unset($this->_listeners[$event]);
        } else {
            $this->_listeners = array();
        }
    }
}
{'fraction_non_alphanumeric': 0.13844144536351763, 'fraction_numerical': 0.0, 'mean_word_length': 1.694021101992966, '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': '4585478', 'n_tokens_mistral': 632, 'n_tokens_neox': 625, 'n_words': 120}