<commit_before><?php
namespace LazyRecord\Schema;

class ColumnDiff {
    public $name;
    public $flag;
    public $column;

    public function __construct($name,$flag,$column)
    {
        $this->name = $name;
        $this->flag = $flag;
        $this->column = $column;
    }
}

class AttributeDiff {
    public $name;
    public $flag;
    public $attribute;
}

class Comparator
{


    /**
     * compare two schemas
     *
     * @param Schema $a old schema 
     * @param Schema $b new schema
     */
    static function compare( $a, $b ) 
    {
        $diff = array();

        $aColumns = $a->getColumns();
        $bColumns = $b->getColumns();
        $columnKeys = array_merge(array_keys($aColumns) , array_keys($bColumns));
        foreach( $columnKeys as $key ) {
            if( isset($aColumns[$key]) && isset($bColumns[ $key ] ) ) {
                // have the same column, compare attributes
                $attributes = array('type','isa','default','label');
                foreach( $attributes as $attributeName ) {

                }
            }
            elseif( isset($aColumns[$key]) ) 
            {
                // flag: -
                $diff[] = new ColumnDiff($key,'-',$column);
            }
            elseif( isset($bColumns[$key]) ) 
            {
                // flag: +
                $diff[] = new ColumnDiff($key,'+',$column);
            }
        }
        return $diff;
    }

}


<commit_msg>attribute diff constructor<commit_after><?php
namespace LazyRecord\Schema;

class ColumnDiff {
    public $name;
    public $flag;
    public $column;

    public function __construct($name,$flag,$column)
    {
        $this->name = $name;
        $this->flag = $flag;
        $this->column = $column;
    }
}

class AttributeDiff 
{

    public $name;
    public $flag;
    public $value;

    public function __construct($name,$flag,$value)
    {
        list( $this->name, $this->flag, $this->value ) = array($name,$flag,$value);
    }

}

class Comparator
{


    /**
     * compare two schemas
     *
     * @param Schema $a old schema 
     * @param Schema $b new schema
     */
    static function compare( $a, $b ) 
    {
        $diff = array();

        $aColumns = $a->getColumns();
        $bColumns = $b->getColumns();
        $columnKeys = array_merge(array_keys($aColumns) , array_keys($bColumns));
        foreach( $columnKeys as $key ) {
            if( isset($aColumns[$key]) && isset($bColumns[ $key ] ) ) {
                // have the same column, compare attributes
                $attributes = array('type','isa','default','label');
                foreach( $attributes as $attributeName ) {

                }
            }
            elseif( isset($aColumns[$key]) ) 
            {
                // flag: -
                $diff[] = new ColumnDiff($key,'-',$column);
            }
            elseif( isset($bColumns[$key]) ) 
            {
                // flag: +
                $diff[] = new ColumnDiff($key,'+',$column);
            }
        }
        return $diff;
    }

}



{'fraction_non_alphanumeric': 0.14845024469820556, 'fraction_numerical': 0.0, 'mean_word_length': 1.666086956521739, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '2215964', 'n_tokens_mistral': 909, 'n_tokens_neox': 883, 'n_words': 192}