<commit_before><?php
namespace COI\Social;

class Manager {
    
    private $elements = array();
    
    public function __construct($elements = array()) {
        $this->elements = $elements;
    }
    
    public function buttons($exclude = array()) {        
        $html = '';
        foreach ($this->elements as $name => $element) {
            if (!$exclude || !in_array($name, $exclude)) {
                $html .= $element->button();
            }
        }
        return $html;
    }
    
    public function scripts() {
            
        $scripts = array();
        ob_start();
        include __DIR__.'/../../templates/script.php';
        $scripts[] = ob_get_clean();
        
        foreach ($this->elements as $element) {
            $scripts[] = $element->script();
        }
        return implode('', $scripts);
    }
    
    public function __set($name, $value) {
        echo "Setting '$name' to '$value'\n";
        $this->elements[$name] = $value;
    }
    
    public function __get($name){
        echo "Getting '$name'\n";
        if (array_key_exists($name, $this->elements)) {
            return $this->elements[$name];
        }<commit_msg>Wrap buttons in a div to allow for easier styling.<commit_after><?php
namespace COI\Social;

class Manager {
    
    private $elements = array();
    
    public function __construct($elements = array()) {
        $this->elements = $elements;
    }
    
    public function buttons($exclude = array()) {        
        $html = '';
        foreach ($this->elements as $name => $element) {
            if (!$exclude || !in_array($name, $exclude)) {
                $html .= "<div class='coi-button coi-button-{$name}'>{$element->button()}</div>";
            }
        }
        return $html;
    }
    
    public function scripts() {
            
        $scripts = array();
        ob_start();
        include __DIR__.'/../../templates/script.php';
        $scripts[] = ob_get_clean();
        
        foreach ($this->elements as $element) {
            $scripts[] = $element->script();
        }
        return implode('', $scripts);
    }
    
    public function __set($name, $value) {
        echo "Setting '$name' to '$value'\n";
        $this->elements[$name] = $value;
    }
    
    public function __get($name){
        echo "Getting '$name'\n";
        if (array_key_exists($name, $this->elements)) {
            return $this->elements[$name];
        }
{'fraction_non_alphanumeric': 0.161620294599018, 'fraction_numerical': 0.0, 'mean_word_length': 1.820069204152249, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '622088', 'n_tokens_mistral': 691, 'n_tokens_neox': 678, 'n_words': 157}