File tree Expand file tree Collapse file tree 2 files changed +6
-24
lines changed
Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Original file line number Diff line number Diff line change 55namespace Shlinkio \Shlink \Installer \Command ;
66
77use Shlinkio \Shlink \Installer \Service \InstallationRunnerInterface ;
8+ use Symfony \Component \Console \Attribute \AsCommand ;
89use Symfony \Component \Console \Command \Command ;
9- use Symfony \Component \Console \Input \InputInterface ;
10- use Symfony \Component \Console \Output \OutputInterface ;
1110use Symfony \Component \Console \Style \SymfonyStyle ;
1211
12+ #[AsCommand(InstallCommand::NAME , 'Guides you through the installation process, to get Shlink up and running ' )]
1313class InstallCommand extends Command
1414{
1515 public const string NAME = 'install ' ;
@@ -19,18 +19,9 @@ public function __construct(private readonly InstallationRunnerInterface $instal
1919 parent ::__construct ();
2020 }
2121
22- protected function configure ( ): void
22+ public function __invoke ( SymfonyStyle $ io ): int
2323 {
24- $ this
25- ->setName (self ::NAME )
26- ->setDescription ('Guides you through the installation process, to get Shlink up and running. ' );
27- }
28-
29- protected function execute (InputInterface $ input , OutputInterface $ output ): int
30- {
31- $ io = new SymfonyStyle ($ input , $ output );
3224 $ initCommand = $ this ->getApplication ()?->find(InitCommand::NAME );
33-
3425 return $ this ->installationRunner ->runInstallation ($ initCommand , $ io );
3526 }
3627}
Original file line number Diff line number Diff line change 55namespace Shlinkio \Shlink \Installer \Command ;
66
77use Shlinkio \Shlink \Installer \Service \InstallationRunnerInterface ;
8+ use Symfony \Component \Console \Attribute \AsCommand ;
89use Symfony \Component \Console \Command \Command ;
9- use Symfony \Component \Console \Input \InputInterface ;
10- use Symfony \Component \Console \Output \OutputInterface ;
1110use Symfony \Component \Console \Style \SymfonyStyle ;
1211
12+ #[AsCommand(UpdateCommand::NAME , 'Helps you import Shlink \'s config from an older version to a new one ' )]
1313class UpdateCommand extends Command
1414{
1515 public const string NAME = 'update ' ;
@@ -19,18 +19,9 @@ public function __construct(private readonly InstallationRunnerInterface $instal
1919 parent ::__construct ();
2020 }
2121
22- protected function configure ( ): void
22+ public function __invoke ( SymfonyStyle $ io ): int
2323 {
24- $ this
25- ->setName (self ::NAME )
26- ->setDescription ('Helps you import Shlink \'s config from an older version to a new one. ' );
27- }
28-
29- protected function execute (InputInterface $ input , OutputInterface $ output ): int
30- {
31- $ io = new SymfonyStyle ($ input , $ output );
3224 $ initCommand = $ this ->getApplication ()?->find(InitCommand::NAME );
33-
3425 return $ this ->installationRunner ->runUpdate ($ initCommand , $ io );
3526 }
3627}
You can’t perform that action at this time.
0 commit comments