mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
30 lines
828 B
PHP
Executable File
30 lines
828 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
declare(strict_types = 1);
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
use Rector\Compiler\Console\RectorCompilerConsoleApplication;
|
|
use Rector\Compiler\HttpKernel\RectorCompilerKernel;
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
final class ContainerFactory
|
|
{
|
|
public function create(): ContainerInterface
|
|
{
|
|
$environment = 'prod' . random_int(1, 10000000);
|
|
$rectorCompilerKernel = new RectorCompilerKernel($environment, true);
|
|
$rectorCompilerKernel->boot();
|
|
|
|
return $rectorCompilerKernel->getContainer();
|
|
}
|
|
}
|
|
|
|
$containerFactory = new ContainerFactory();
|
|
$container = $containerFactory->create();
|
|
|
|
/** @var RectorCompilerConsoleApplication $application */
|
|
$application = $container->get(RectorCompilerConsoleApplication::class);
|
|
exit($application->run());
|