<commit_before><?php

if (!class_exists('\Symfony\Component\Console\Application')) {
    if (file_exists($file = __DIR__.'/../../../autoload.php') || file_exists($file = __DIR__.'/../autoload.php')) {
        require_once $file;
    } elseif (file_exists($file = __DIR__.'/../autoload.php.dist')) {
        require_once $file;
    }
}

use Symfony\Component\Finder\Finder;

use Propel\Runtime\Propel;
use Propel\Generator\Application;

$finder = new Finder();
$finder->files()->name('*.php')->in(__DIR__.'/../src/Propel/Generator/Command')->depth(0);

$app = new Application('Propel', Propel::VERSION);

$ns = '\\Propel\\Generator\\Command\\';

foreach ($finder as $file) {
    $r  = new \ReflectionClass($ns.$file->getBasename('.php'));
    if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
        $app->add($r->newInstance());
    }
}

$app->run();
<commit_msg>refactor bin/propel.php<commit_after><?php

if (!class_exists(\Symfony\Component\Console\Application::class)) {
    $autoloadFiles = [
        __DIR__ . '/../../../autoload.php',
        __DIR__ . '/../autoload.php',
        __DIR__ . '/../autoload.php.dist',
    ];
    foreach ($autoloadFiles as $file) {
        if (file_exists($file)) {
            require_once $file;

            break;
        }
    }
}

use Propel\Generator\Application;
use Propel\Runtime\Propel;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Finder\Finder;

$finder = new Finder();
$finder->files()->name('*.php')->in(__DIR__ . '/../src/Propel/Generator/Command')->depth(0);

$app = new Application('Propel', Propel::VERSION);

$ns = '\\Propel\\Generator\\Command\\';

foreach ($finder as $file) {
    $r = new \ReflectionClass($ns . $file->getBasename('.php'));
    if ($r->isSubclassOf(Command::class) && !$r->isAbstract()) {
        $app->add($r->newInstance());
    }
}

$app->run();

{'fraction_non_alphanumeric': 0.2209915611814346, 'fraction_numerical': 0.0010548523206751054, 'mean_word_length': 3.224944320712695, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6090144', 'n_tokens_mistral': 641, 'n_tokens_neox': 647, 'n_words': 95}