mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Match new symfony syntax
This commit is contained in:
@@ -65,11 +65,11 @@ class DeviceAdd extends LnmsCommand
|
||||
$this->addOption('port', 'r', InputOption::VALUE_REQUIRED);
|
||||
$this->addOption('transport', 't', InputOption::VALUE_REQUIRED);
|
||||
$this->addOption('display-name', 'd', InputOption::VALUE_REQUIRED);
|
||||
$this->addOption('security-name', 'u', InputOption::VALUE_REQUIRED, null, 'root');
|
||||
$this->addOption('security-name', 'u', InputOption::VALUE_REQUIRED, '', 'root');
|
||||
$this->addOption('auth-password', 'A', InputOption::VALUE_REQUIRED);
|
||||
$this->addOption('auth-protocol', 'a', InputOption::VALUE_REQUIRED, null, 'MD5');
|
||||
$this->addOption('auth-protocol', 'a', InputOption::VALUE_REQUIRED, '', 'MD5');
|
||||
$this->addOption('privacy-password', 'X', InputOption::VALUE_REQUIRED);
|
||||
$this->addOption('privacy-protocol', 'x', InputOption::VALUE_REQUIRED, null, 'AES');
|
||||
$this->addOption('privacy-protocol', 'x', InputOption::VALUE_REQUIRED, '', 'AES');
|
||||
$this->addOption('force', 'f', InputOption::VALUE_NONE);
|
||||
$this->addOption('ping-fallback', 'b', InputOption::VALUE_NONE);
|
||||
$this->addOption('poller-group', 'g', InputOption::VALUE_REQUIRED);
|
||||
|
||||
@@ -27,7 +27,7 @@ class SnmpFetch extends LnmsCommand
|
||||
$this->addArgument('oid', InputArgument::REQUIRED);
|
||||
$this->addOption('type', 't', InputOption::VALUE_REQUIRED, trans('commands.snmp:fetch.options.type', ['types' => '[get, walk, next, translate]']), 'get');
|
||||
$this->addOption('output', 'o', InputOption::VALUE_REQUIRED, trans('commands.snmp:fetch.options.output', ['formats' => '[value, values, table]']));
|
||||
$this->addOption('depth', 'd', InputOption::VALUE_REQUIRED, null, 1);
|
||||
$this->addOption('depth', 'd', InputOption::VALUE_REQUIRED, '', 1);
|
||||
$this->addOption('numeric', 'i', InputOption::VALUE_NONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class DynamicInputOption extends InputOption
|
||||
parent::__construct($name, $shortcut, $mode, $description, $default);
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
public function getDescription(): string
|
||||
{
|
||||
$description = parent::getDescription();
|
||||
|
||||
@@ -53,7 +53,7 @@ class DynamicInputOption extends InputOption
|
||||
return $description;
|
||||
}
|
||||
|
||||
public function getDefault()
|
||||
public function getDefault(): array|string|int|float|bool|null
|
||||
{
|
||||
if (is_callable($this->defaultCallable)) {
|
||||
return call_user_func($this->defaultCallable);
|
||||
|
||||
@@ -71,7 +71,7 @@ abstract class LnmsCommand extends Command
|
||||
*
|
||||
* @throws InvalidArgumentException When argument mode is not valid
|
||||
*/
|
||||
public function addArgument($name, $mode = null, $description = null, $default = null)
|
||||
public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null): static
|
||||
{
|
||||
// use a generated translation location by default
|
||||
if (is_null($description)) {
|
||||
@@ -96,7 +96,7 @@ abstract class LnmsCommand extends Command
|
||||
*
|
||||
* @throws InvalidArgumentException If option mode is invalid or incompatible
|
||||
*/
|
||||
public function addOption($name, $shortcut = null, $mode = null, $description = null, $default = null)
|
||||
public function addOption(string $name, array|string|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null): static
|
||||
{
|
||||
// use a generated translation location by default
|
||||
if (is_null($description)) {
|
||||
|
||||
Reference in New Issue
Block a user