<commit_before><?php
 
/**
 * Description of plugin
 * @author <NAME> <<EMAIL>>
 * @license http://opensource.org/licenses/MIT
 * @version 0.1
 */
 
require_once(INCLUDE_DIR . 'class.plugin.php');
require_once(INCLUDE_DIR . 'class.signal.php');
require_once(INCLUDE_DIR . 'class.app.php');
 
require_once('config.php');

class SpreaderPlugin extends Plugin {
 
    var $config_class = 'SpreaderConfig';
    private static $config;
    function bootstrap() {
        self::$config = self::getConfig();
        if (!self::$config->get('spreader_current_staff')) {
            self::$config->set('spreader_current_staff', 0);
        }   
        $object = Signal::connect('model.created', array('SpreaderPlugin', 'spreadTicket'));
    }
    
    function getCurrentStaffId() {
        $staff = self::$config->getStaffList();
        $plugin_staff = array();
        $current_staff = self::$config->get('spreader_current_staff');
        foreach ($staff as $id => $fullname) {
            if(self::$config->get("spreader_staff_id_".$id)){
                array_push($plugin_staff, $id);
            }
        }
        $current = $plugin_staff[$current_staff];
        if($current_staff >= count($plugin_staff)-1){
            self::$config->set('spreader_current_staff', 0);
        } else {
            self::$config->set('spreader_current_staff', self::$config->get('spreader_current_staff')+1);
        }
        return $current;
    }
<commit_msg>Fix issue #4<commit_after><?php
 
/**
 * Description of plugin
 * @author <NAME> <<EMAIL>>
 * @license http://opensource.org/licenses/MIT
 * @version 0.1
 */
 
require_once(INCLUDE_DIR . 'class.plugin.php');
require_once(INCLUDE_DIR . 'class.signal.php');
require_once(INCLUDE_DIR . 'class.app.php');
 
require_once('config.php');

class SpreaderPlugin extends Plugin {
 
    var $config_class = 'SpreaderConfig';
    private static $config;
    function bootstrap() {
        self::$config = self::getConfig();
        if (!self::$config->get('spreader_current_staff')) {
            self::$config->set('spreader_current_staff', 0);
        }   
        $object = Signal::connect('ticket.created', array('SpreaderPlugin', 'spreadTicket'));
    }
    
    function getCurrentStaffId() {
        $staff = self::$config->getStaffList();
        $plugin_staff = array();
        $current_staff = self::$config->get('spreader_current_staff');
        foreach ($staff as $id => $fullname) {
            if(self::$config->get("spreader_staff_id_".$id)){
                array_push($plugin_staff, $id);
            }
        }
        $current = $plugin_staff[$current_staff];
        if($current_staff >= count($plugin_staff)-1){
            self::$config->set('spreader_current_staff', 0);
        } else {
            self::$config->set('spreader_current_staff', self::$config->get('spreader_current_staff')+1);
        }
        return $current;
    }

{'fraction_non_alphanumeric': 0.1652864044168392, 'fraction_numerical': 0.004485852311939268, 'mean_word_length': 2.9986206896551724, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '4762035', 'n_tokens_mistral': 897, 'n_tokens_neox': 873, 'n_words': 136}