chore: removes unused code

This commit is contained in:
2025-05-16 13:16:20 -05:00
parent 7bc8720377
commit 4cb9fd0810
4 changed files with 0 additions and 141 deletions

View File

@@ -1,36 +0,0 @@
<?php
namespace App\User\Framework\Pipeline\GettingStarted;
use App\User\Framework\Repository\PreferencesRepository;
use League\Pipeline\StageInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
class AddPreferencesToDatabase implements StageInterface
{
/** @var GettingStartedInput $input */
public function __invoke($input)
{
if ($input->preferenceRepository->count() > 0) {
$input->logger->info('[AddPreferencesToDatabase] > Preferences already exist, skipping...');
return $input;
}
$app = new Application($input->kernel);
$app->setAutoExit(false);
$commandInput = new ArrayInput([
'command' => 'doctrine:fixtures:load',
'--no-interaction',
]);
$output = new BufferedOutput();
$app->run($commandInput, $output);
return $input;
}
}

View File

@@ -1,16 +0,0 @@
<?php
namespace App\User\Framework\Pipeline\GettingStarted;
use App\User\Framework\Repository\PreferencesRepository;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\KernelInterface;
class GettingStartedInput
{
public function __construct(
public readonly KernelInterface $kernel,
public readonly PreferencesRepository $preferenceRepository,
public readonly LoggerInterface $logger
) {}
}

View File

@@ -1,31 +0,0 @@
<?php
namespace App\User\Framework\Pipeline\GettingStarted;
use League\Pipeline\StageInterface;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Bundle\FrameworkBundle\Console\Application;
class MigrateDatabase implements StageInterface
{
/** @var GettingStartedInput $input */
public function __invoke($input)
{
$app = new Application($input->kernel);
$app->setAutoExit(false);
$commandInput = new ArrayInput([
'command' => 'doctrine:migrations:migrate',
'--no-interaction' => true,
]);
$output = new BufferedOutput();
$app->run($commandInput, $output);
$input->logger->info('[MigrateDatabase] > Migrating database...', ['output' => $output->fetch()]);
return $input;
}
}