diff --git a/Command/BroadcasterCommand.php b/Command/BroadcasterCommand.php index 79cd576..b93c6cc 100644 --- a/Command/BroadcasterCommand.php +++ b/Command/BroadcasterCommand.php @@ -9,7 +9,7 @@ use Martin1982\LiveBroadcastBundle\Broadcaster\Scheduler; use Psr\Log\LoggerInterface; -use React\EventLoop\Factory; +use React\EventLoop\Loop; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -24,17 +24,17 @@ class BroadcasterCommand extends Command /** * @var Scheduler */ - private $scheduler; + private Scheduler $scheduler; /** * @var LoggerInterface */ - private $logger; + private LoggerInterface $logger; /** * @var int */ - private $eventLoopTimer; + private int $eventLoopTimer; /** * @var string @@ -47,7 +47,7 @@ class BroadcasterCommand extends Command * @param int $eventLoopTimer * */ - public function __construct(Scheduler $scheduler, LoggerInterface $logger, $eventLoopTimer = 10) + public function __construct(Scheduler $scheduler, LoggerInterface $logger, int $eventLoopTimer = 10) { $this->scheduler = $scheduler; $this->logger = $logger; @@ -69,11 +69,11 @@ protected function configure(): void /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $scheduler = $this->scheduler; - $eventLoop = Factory::create(); + $eventLoop = Loop::get(); $eventLoop->addPeriodicTimer( $this->eventLoopTimer, function () use ($scheduler) { @@ -86,5 +86,7 @@ function () use ($scheduler) { ); $eventLoop->run(); + + return 0; } } diff --git a/Command/ShellTestCommand.php b/Command/ShellTestCommand.php index 86586cd..7fcf656 100644 --- a/Command/ShellTestCommand.php +++ b/Command/ShellTestCommand.php @@ -21,17 +21,17 @@ class ShellTestCommand extends Command /** * @var bool */ - private $isWindows = false; + private bool $isWindows = false; /** * @var bool */ - private $isMac = false; + private bool $isMac = false; /** * @var bool */ - private $isLinux = false; + private bool $isLinux = false; /** * @var string @@ -51,7 +51,7 @@ protected function configure(): void /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { switch (strtoupper(substr(PHP_OS, 0, 3))) { case 'WIN': @@ -89,6 +89,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->write('Checking \'grep\' command availability... '); $this->testGrep($output); } + + return 0; } /** @@ -164,7 +166,7 @@ protected function testKill(OutputInterface $output): void * @param string $testable * @param OutputInterface $output */ - protected function analyseResult($cmdResult, $testable, OutputInterface $output): void + protected function analyseResult(array $cmdResult, string $testable, OutputInterface $output): void { if (count($cmdResult) && 0 !== preg_match('/'.$testable.'/', implode($cmdResult))) { $output->writeln('[OK]');