<commit_before><?php

namespace FlexModel\FlexModelBundle\DependencyInjection;

use DOMDocument;
use FlexModel\FlexModel;

/**
 * FlexModelFactory.
 *
 * @author <NAME> <<EMAIL>>
 */
class FlexModelFactory
{
    /**
     * Creates a new FlexModel instance.
     *
     * @param string $identifier
     * @param string $resource
     * @param string $cachePath
     *
     * @return FlexModel
     */
    public static function createFlexModel($identifier, $resource, $cachePath)
    {
        $domDocument = new DOMDocument('1.0', 'UTF-8');
        $domDocument->load($resource);

        $flexModel = new FlexModel($identifier);
        $flexModel->load($domDocument, $cachePath);

        return $flexModel;
    }
}<commit_msg>Add XInclude support to FlexModel configuration loading in FlexModelFactory<commit_after><?php

namespace FlexModel\FlexModelBundle\DependencyInjection;

use DOMDocument;
use FlexModel\FlexModel;

/**
 * FlexModelFactory.
 *
 * @author <NAME> <<EMAIL>>
 */
class FlexModelFactory
{
    /**
     * Creates a new FlexModel instance.
     *
     * @param string $identifier
     * @param string $resource
     * @param string $cachePath
     *
     * @return FlexModel
     */
    public static function createFlexModel($identifier, $resource, $cachePath)
    {
        $domDocument = new DOMDocument('1.0', 'UTF-8');
        $domDocument->load($resource);
        $domDocument->xinclude();

        $flexModel = new FlexModel($identifier);
        $flexModel->load($domDocument, $cachePath);

        return $flexModel;
    }
}
{'fraction_non_alphanumeric': 0.12483912483912483, 'fraction_numerical': 0.003861003861003861, 'mean_word_length': 3.0180878552971575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '6706089', 'n_tokens_mistral': 470, 'n_tokens_neox': 444, 'n_words': 103}