From 4cb9fd0810eeec27b6f3a8bcf39cc41d57efd89a Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Fri, 16 May 2025 13:16:20 -0500 Subject: [PATCH] chore: removes unused code --- src/Command/ProvisionCommand.php | 58 ------------------- .../AddPreferencesToDatabase.php | 36 ------------ .../GettingStarted/GettingStartedInput.php | 16 ----- .../GettingStarted/MigrateDatabase.php | 31 ---------- 4 files changed, 141 deletions(-) delete mode 100644 src/Command/ProvisionCommand.php delete mode 100644 src/User/Framework/Pipeline/GettingStarted/AddPreferencesToDatabase.php delete mode 100644 src/User/Framework/Pipeline/GettingStarted/GettingStartedInput.php delete mode 100644 src/User/Framework/Pipeline/GettingStarted/MigrateDatabase.php diff --git a/src/Command/ProvisionCommand.php b/src/Command/ProvisionCommand.php deleted file mode 100644 index c1d9843..0000000 --- a/src/Command/ProvisionCommand.php +++ /dev/null @@ -1,58 +0,0 @@ -preferencesRepository = $preferencesRepository; - $this->logger = $logger; - $this->kernel = $kernel; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $io = new SymfonyStyle($input, $output); - - $pipelineInput = new GettingStartedInput( - kernel: $this->kernel, - preferenceRepository: $this->preferencesRepository, - logger: $this->logger, - ); - - $pipeline = (new Pipeline) - ->pipe(new MigrateDatabase) - ->pipe(new AddPreferencesToDatabase); - - $pipeline->process($pipelineInput); - - $io->success('You have a new command! Now make it your own! Pass --help to see your options.'); - - return Command::SUCCESS; - } -} diff --git a/src/User/Framework/Pipeline/GettingStarted/AddPreferencesToDatabase.php b/src/User/Framework/Pipeline/GettingStarted/AddPreferencesToDatabase.php deleted file mode 100644 index 4d2cff4..0000000 --- a/src/User/Framework/Pipeline/GettingStarted/AddPreferencesToDatabase.php +++ /dev/null @@ -1,36 +0,0 @@ -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; - } -} \ No newline at end of file diff --git a/src/User/Framework/Pipeline/GettingStarted/GettingStartedInput.php b/src/User/Framework/Pipeline/GettingStarted/GettingStartedInput.php deleted file mode 100644 index e8cbd7c..0000000 --- a/src/User/Framework/Pipeline/GettingStarted/GettingStartedInput.php +++ /dev/null @@ -1,16 +0,0 @@ -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; - } -} \ No newline at end of file