Apply fixes from StyleCI (#12117)

* Apply fixes from StyleCI

* Disable style check
This commit is contained in:
Jellyfrog
2020-09-21 14:54:51 +02:00
committed by GitHub
parent 8ec9183df5
commit 77c531527c
752 changed files with 6238 additions and 5833 deletions

View File

@@ -9,12 +9,12 @@ use LibreNMS\Util\Snmpsim;
$install_dir = realpath(__DIR__ . '/..');
chdir($install_dir);
$init_modules = array('discovery', 'polling');
$init_modules = ['discovery', 'polling'];
require $install_dir . '/includes/init.php';
$options = getopt(
'h:m:no:v:f:d',
array(
[
'hostname:',
'modules:',
'prefer-new',
@@ -24,7 +24,7 @@ $options = getopt(
'debug',
'snmpsim',
'help',
)
]
);
if (isset($options['snmpsim'])) {
@@ -43,7 +43,7 @@ if (isset($options['h'])) {
if (isset($hostname)) {
if (is_numeric($hostname)) {
$device = device_by_id_cache($hostname);
} elseif (!empty($hostname)) {
} elseif (! empty($hostname)) {
$device = device_by_name($hostname);
}
@@ -89,7 +89,7 @@ if (isset($options['m'])) {
$modules = explode(',', $modules_input);
} else {
$modules_input = 'all';
$modules = array();
$modules = [];
}
$variant = '';
@@ -113,7 +113,6 @@ echo PHP_EOL;
try {
$capture = new ModuleTestHelper($modules, $target_os, $variant);
if (isset($options['f'])) {
$capture->setSnmprecSavePath($options['f']);
} elseif (isset($options['file'])) {
@@ -122,7 +121,6 @@ try {
$prefer_new_snmprec = isset($options['n']) || isset($options['prefer-new']);
echo "Capturing Data: ";
\LibreNMS\Util\OS::updateCache(true); // Force update of OS Cache
$capture->captureFromDevice($device['device_id'], true, $prefer_new_snmprec);