<commit_before><?php declare(strict_types=1);

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEmbeddableFromArchetypeCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEntityCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateFieldCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateRelationsCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\RemoveUnusedRelationsCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetEmbeddableCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetFieldCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetRelationCommand;
use EdmondsCommerce\DoctrineStaticMeta\Container;
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
use EdmondsCommerce\DoctrineStaticMeta\Exception\ErrorException;
use EdmondsCommerce\DoctrineStaticMeta\Schema\Schema;
use EdmondsCommerce\DoctrineStaticMeta\SimpleEnv;

require __DIR__.'/vendor/autoload.php';

set_error_handler(
    function ($severity, $message, $file, $line) {
        if (!(error_reporting() & $severity)) {
            // This error code is not included in error_reporting
            return;
        }
        throw new ErrorException($message, 0, $severity, $file, $line);
    }
);

try {

    SimpleEnv::setEnv(__DIR__.'/.env');
    $container = new Container();
    $container->buildSymfonyContainer($_SERVER);

    $schemaBuilder = $container->get(Schema::class);
    $schemaBuilder->validate()->update();

// This adds the DSM commands into the standard doctrine bin
    $commands = [
        $container->get(GenerateRelationsCommand::class),
        $container->get(GenerateEntityCommand::class),
        $container->get(SetRelationCommand::class),
        $container->get(GenerateFieldCommand::class),
        $container->get(SetFieldCommand::class),
        $container->get(SetEmbeddableCommand::class),
        $container->get(GenerateEmbeddableFromArchetypeCommand::class),
        $container->get(RemoveUnusedRelationsCommand::class),
    ];

    $entityManager = $container->get(EntityManager::class);
} catch (DoctrineStaticMetaException | ErrorException $e) {
    throw new DoctrineStaticMetaException('Exception setting up Doctrine CLI: '.$e->getMessage(), $e->getCode(), $e);
}

return ConsoleRunner::createHelperSet($entityManager);
<commit_msg>Updating another reference to the EntityManager<commit_after><?php declare(strict_types=1);

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEmbeddableFromArchetypeCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateEntityCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateFieldCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\GenerateRelationsCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\RemoveUnusedRelationsCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetEmbeddableCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetFieldCommand;
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Command\SetRelationCommand;
use EdmondsCommerce\DoctrineStaticMeta\Container;
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
use EdmondsCommerce\DoctrineStaticMeta\Exception\ErrorException;
use EdmondsCommerce\DoctrineStaticMeta\Schema\Schema;
use EdmondsCommerce\DoctrineStaticMeta\SimpleEnv;

require __DIR__.'/vendor/autoload.php';

set_error_handler(
    function ($severity, $message, $file, $line) {
        if (!(error_reporting() & $severity)) {
            // This error code is not included in error_reporting
            return;
        }
        throw new ErrorException($message, 0, $severity, $file, $line);
    }
);

try {

    SimpleEnv::setEnv(__DIR__.'/.env');
    $container = new Container();
    $container->buildSymfonyContainer($_SERVER);

    $schemaBuilder = $container->get(Schema::class);
    $schemaBuilder->validate()->update();

// This adds the DSM commands into the standard doctrine bin
    $commands = [
        $container->get(GenerateRelationsCommand::class),
        $container->get(GenerateEntityCommand::class),
        $container->get(SetRelationCommand::class),
        $container->get(GenerateFieldCommand::class),
        $container->get(SetFieldCommand::class),
        $container->get(SetEmbeddableCommand::class),
        $container->get(GenerateEmbeddableFromArchetypeCommand::class),
        $container->get(RemoveUnusedRelationsCommand::class),
    ];

    $entityManager = $container->get(EntityManagerInterface::class);
} catch (DoctrineStaticMetaException | ErrorException $e) {
    throw new DoctrineStaticMetaException('Exception setting up Doctrine CLI: '.$e->getMessage(), $e->getCode(), $e);
}

return ConsoleRunner::createHelperSet($entityManager);

{'fraction_non_alphanumeric': 0.10850155279503106, 'fraction_numerical': 0.0007763975155279503, 'mean_word_length': 5.926075268817204, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '1593983', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1417, 'n_words': 217}