<commit_before><?php
namespace LazyRecord\Schema\Factory;
use ClassTemplate\ClassTemplate;
use LazyRecord\Schema\SchemaInterface;
use LazyRecord\Schema\SchemaDeclare;

class BaseModelClassFactory
{
    public static function create(SchemaDeclare $schema, $baseClass) {
        $cTemplate = new ClassTemplate( $schema->getBaseModelClass() , array(
            'template' => 'Class.php.twig',
        ));
        $cTemplate->addConsts(array(
            'schema_proxy_class' => $schema->getSchemaProxyClass(),
            'collection_class' => $schema->getCollectionClass(),
            'model_class' => $schema->getModelClass(),
            'table' => $schema->getTable(),
        ));
        $cTemplate->addStaticVar( 'column_names',  $schema->getColumnNames() );
        $cTemplate->addStaticVar( 'column_hash',  array_fill_keys($schema->getColumnNames(), 1 ) );
        $cTemplate->addStaticVar( 'mixin_classes', array_reverse($schema->getMixinSchemaClasses()) );
        $cTemplate->extendClass( '\\' . $baseClass );
        foreach($schema->getModelTraits() as $modelTrait) {
            $cTemplate->traits[] = $modelTrait;
        }
        return $cTemplate;
    }
}
<commit_msg>use addTrait()<commit_after><?php
namespace LazyRecord\Schema\Factory;
use ClassTemplate\ClassTemplate;
use LazyRecord\Schema\SchemaInterface;
use LazyRecord\Schema\SchemaDeclare;

class BaseModelClassFactory
{
    public static function create(SchemaDeclare $schema, $baseClass) {
        $cTemplate = new ClassTemplate( $schema->getBaseModelClass() , array(
            'template' => 'Class.php.twig',
        ));
        $cTemplate->addConsts(array(
            'schema_proxy_class' => $schema->getSchemaProxyClass(),
            'collection_class' => $schema->getCollectionClass(),
            'model_class' => $schema->getModelClass(),
            'table' => $schema->getTable(),
        ));
        $cTemplate->addStaticVar( 'column_names',  $schema->getColumnNames() );
        $cTemplate->addStaticVar( 'column_hash',  array_fill_keys($schema->getColumnNames(), 1 ) );
        $cTemplate->addStaticVar( 'mixin_classes', array_reverse($schema->getMixinSchemaClasses()) );
        $cTemplate->extendClass( '\\' . $baseClass );
        foreach($schema->getModelTraits() as $modelTrait) {
            $cTemplate->addTrait($modelTrait);
        }
        return $cTemplate;
    }
}

{'fraction_non_alphanumeric': 0.14725738396624471, 'fraction_numerical': 0.0008438818565400844, 'mean_word_length': 3.3424908424908426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '3746269', 'n_tokens_mistral': 686, 'n_tokens_neox': 688, 'n_words': 104}