99namespace Mezzio \Swoole \Command ;
1010
1111use Symfony \Component \Console \Application ;
12+ use Symfony \Component \Console \Attribute \AsCommand ;
1213use Symfony \Component \Console \Command \Command ;
1314use Symfony \Component \Console \Input \ArrayInput ;
1415use Symfony \Component \Console \Input \InputInterface ;
1920
2021use const SWOOLE_PROCESS ;
2122
23+ #[AsCommand('mezzio:swoole:reload ' )]
2224class ReloadCommand extends Command
2325{
2426 /**
@@ -33,7 +35,11 @@ class ReloadCommand extends Command
3335configuration value is set to SWOOLE_PROCESS.
3436EOH;
3537
36- /** @var null|string Cannot be defined explicitly due to parent class */
38+ /**
39+ * @deprecated Use ReloadCommand::getDefaultName() instead. Will be removed in 5.0.0
40+ *
41+ * @var null|string
42+ */
3743 public static $ defaultName = 'mezzio:swoole:reload ' ;
3844
3945 public function __construct (private int $ serverMode )
@@ -73,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7379 /** @var Application $application */
7480 $ application = $ this ->getApplication ();
7581
76- $ stop = $ application ->find (StopCommand::$ defaultName );
82+ $ stop = $ application ->find (StopCommand::getDefaultName () );
7783 $ result = $ stop ->run (new ArrayInput ([
7884 'command ' => 'stop ' ,
7985 ]), $ output );
@@ -92,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9298 $ output ->writeln ('<info>[DONE]</info> ' );
9399 $ output ->writeln ('<info>Starting server</info> ' );
94100
95- $ start = $ application ->find (StartCommand::$ defaultName );
101+ $ start = $ application ->find (StartCommand::getDefaultName () );
96102
97103 $ inputArguments = [
98104 'command ' => 'start ' ,
0 commit comments