diff options
author | Joas Schilling <coding@schilljs.com> | 2019-02-12 18:07:59 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-02-12 18:07:59 +0300 |
commit | fb90a742312eb92898c56451757ebb3a5d916c88 (patch) | |
tree | fad13d0a9e8530e1a791a26d0086e1ee926d8e73 /lib/Command | |
parent | af59422720af0d69a29221d13b1b9b32063db603 (diff) |
Make all classes strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Command')
-rw-r--r-- | lib/Command/Signaling/Add.php | 7 | ||||
-rw-r--r-- | lib/Command/Signaling/Delete.php | 8 | ||||
-rw-r--r-- | lib/Command/Signaling/ListCommand.php | 7 | ||||
-rw-r--r-- | lib/Command/Stun/Add.php | 7 | ||||
-rw-r--r-- | lib/Command/Stun/Delete.php | 7 | ||||
-rw-r--r-- | lib/Command/Stun/ListCommand.php | 7 | ||||
-rw-r--r-- | lib/Command/Turn/Add.php | 6 | ||||
-rw-r--r-- | lib/Command/Turn/Delete.php | 7 | ||||
-rw-r--r-- | lib/Command/Turn/ListCommand.php | 7 |
9 files changed, 26 insertions, 37 deletions
diff --git a/lib/Command/Signaling/Add.php b/lib/Command/Signaling/Add.php index 53ee7ad55..a527d35a5 100644 --- a/lib/Command/Signaling/Add.php +++ b/lib/Command/Signaling/Add.php @@ -36,14 +36,12 @@ class Add extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:signaling:add') ->setDescription('Add an external signaling server.') @@ -63,7 +61,7 @@ class Add extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); $secret = $input->getArgument('secret'); $verify = $input->getOption('verify'); @@ -97,5 +95,6 @@ class Add extends Base { $this->config->setAppValue('spreed', 'signaling_servers', json_encode($signaling)); $output->writeln('<info>Added signaling server ' . $server . '.</info>'); + return 0; } } diff --git a/lib/Command/Signaling/Delete.php b/lib/Command/Signaling/Delete.php index 6a2250041..d66f0abb7 100644 --- a/lib/Command/Signaling/Delete.php +++ b/lib/Command/Signaling/Delete.php @@ -35,14 +35,12 @@ class Delete extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:signaling:delete') ->setDescription('Remove an existing signaling server.') @@ -53,7 +51,7 @@ class Delete extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); $config = $this->config->getAppValue('spreed', 'signaling_servers'); @@ -77,6 +75,6 @@ class Delete extends Base { } else { $output->writeln('<info>There is nothing to delete.</info>'); } - + return 0; } } diff --git a/lib/Command/Signaling/ListCommand.php b/lib/Command/Signaling/ListCommand.php index 42d65f392..384aadb3a 100644 --- a/lib/Command/Signaling/ListCommand.php +++ b/lib/Command/Signaling/ListCommand.php @@ -35,14 +35,12 @@ class ListCommand extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { parent::configure(); $this @@ -50,7 +48,7 @@ class ListCommand extends Base { ->setDescription('List external signaling servers.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $config = $this->config->getAppValue('spreed', 'signaling_servers'); $signaling = json_decode($config, true); if (!is_array($signaling)) { @@ -58,5 +56,6 @@ class ListCommand extends Base { } $this->writeMixedInOutputFormat($input, $output, $signaling); + return 0; } } diff --git a/lib/Command/Stun/Add.php b/lib/Command/Stun/Add.php index bbf66db20..780cc6b8f 100644 --- a/lib/Command/Stun/Add.php +++ b/lib/Command/Stun/Add.php @@ -35,14 +35,12 @@ class Add extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:stun:add') ->setDescription('Add a new STUN server.') @@ -53,7 +51,7 @@ class Add extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); // check input, similar to stun-server.js $host = parse_url($server, PHP_URL_HOST); @@ -74,5 +72,6 @@ class Add extends Base { $this->config->setAppValue('spreed', 'stun_servers', json_encode($servers)); $output->writeln('<info>Added ' . $server . '.</info>'); + return 0; } } diff --git a/lib/Command/Stun/Delete.php b/lib/Command/Stun/Delete.php index 14f542868..db1a4151b 100644 --- a/lib/Command/Stun/Delete.php +++ b/lib/Command/Stun/Delete.php @@ -35,14 +35,12 @@ class Delete extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:stun:delete') ->setDescription('Remove an existing STUN server.') @@ -53,7 +51,7 @@ class Delete extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); $config = $this->config->getAppValue('spreed', 'stun_servers'); @@ -80,5 +78,6 @@ class Delete extends Base { $output->writeln('<info>There is nothing to delete.</info>'); } } + return 0; } } diff --git a/lib/Command/Stun/ListCommand.php b/lib/Command/Stun/ListCommand.php index eed30ab5b..1b6e7a907 100644 --- a/lib/Command/Stun/ListCommand.php +++ b/lib/Command/Stun/ListCommand.php @@ -35,14 +35,12 @@ class ListCommand extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { parent::configure(); $this @@ -50,7 +48,7 @@ class ListCommand extends Base { ->setDescription('List STUN servers.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $config = $this->config->getAppValue('spreed', 'stun_servers'); $servers = json_decode($config); if (!is_array($servers)) { @@ -58,5 +56,6 @@ class ListCommand extends Base { } $this->writeArrayInOutputFormat($input, $output, $servers); + return 0; } } diff --git a/lib/Command/Turn/Add.php b/lib/Command/Turn/Add.php index 1e95acb82..abead2725 100644 --- a/lib/Command/Turn/Add.php +++ b/lib/Command/Turn/Add.php @@ -36,14 +36,12 @@ class Add extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:turn:add') ->setDescription('Add a TURN server.') @@ -68,7 +66,7 @@ class Add extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); $protocols = $input->getArgument('protocols'); $secret = $input->getOption('secret'); diff --git a/lib/Command/Turn/Delete.php b/lib/Command/Turn/Delete.php index 0b000ee85..4201d446d 100644 --- a/lib/Command/Turn/Delete.php +++ b/lib/Command/Turn/Delete.php @@ -35,14 +35,12 @@ class Delete extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { $this ->setName('talk:turn:delete') ->setDescription('Remove an existing TURN server.') @@ -57,7 +55,7 @@ class Delete extends Base { ); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $server = $input->getArgument('server'); $protocols = $input->getArgument('protocols'); @@ -81,5 +79,6 @@ class Delete extends Base { } else { $output->writeln('<info>There is nothing to delete.</info>'); } + return 0; } } diff --git a/lib/Command/Turn/ListCommand.php b/lib/Command/Turn/ListCommand.php index 4bf62396a..4df13ed00 100644 --- a/lib/Command/Turn/ListCommand.php +++ b/lib/Command/Turn/ListCommand.php @@ -35,14 +35,12 @@ class ListCommand extends Base { /** @var IConfig */ private $config; - /** - */ public function __construct(IConfig $config) { parent::__construct(); $this->config = $config; } - protected function configure() { + protected function configure(): void { parent::configure(); $this @@ -50,7 +48,7 @@ class ListCommand extends Base { ->setDescription('List TURN servers.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): ?int { $config = $this->config->getAppValue('spreed', 'turn_servers'); $servers = json_decode($config, true); if (!is_array($servers)) { @@ -58,5 +56,6 @@ class ListCommand extends Base { } $this->writeMixedInOutputFormat($input, $output, $servers); + return 0; } } |