chore: removes unused code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
) {}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user