<commit_before><?php

namespace Amp;

class ReactorFactory {
    
    function select() {
        return $this->hasLibevent() ? new LibeventReactor : new NativeReactor;
    }
    
    /**
     * This method exists to mock the presence of the libevent extension in unit tests
     */
    protected function hasLibevent() {
        return extension_loaded('libevent');
    }
}
<commit_msg>Added magic invoke to reactor factory<commit_after><?php

namespace Amp;

class ReactorFactory {
    
    function __invoke() {
        return $this->select();
    }
    
    function select() {
        return $this->hasLibevent() ? new LibeventReactor : new NativeReactor;
    }
    
    /**
     * This method exists to mock the presence of the libevent extension in unit tests
     */
    protected function hasLibevent() {
        return extension_loaded('libevent');
    }
}

{'fraction_non_alphanumeric': 0.0922722029988466, 'fraction_numerical': 0.0, 'mean_word_length': 2.5867768595041323, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '1652752', 'n_tokens_mistral': 239, 'n_tokens_neox': 239, 'n_words': 73}