From 1220d583e9656c5b087d7029a2e7cfe5c11227f8 Mon Sep 17 00:00:00 2001 From: Jellyfrog Date: Sun, 22 Nov 2020 05:52:58 +0100 Subject: [PATCH] Apply fixes from StyleCI (#12336) --- app/Http/Controllers/Maps/MapController.php | 14 +-- config/auth.php | 8 +- .../backupninja_backupninja.inc.php | 2 +- .../application/freeswitch_callsIn.inc.php | 2 +- .../application/freeswitch_callsOut.inc.php | 2 +- .../application/mailscanner_spam.inc.php | 2 +- .../application/mysql_connections.inc.php | 2 +- .../application/nfs-server_stats_v4.inc.php | 2 +- .../html/graphs/application/nfs-stats.inc.php | 90 +++++++++---------- .../application/nfs-v3-stats_stats.inc.php | 2 +- .../application/nginx_connections.inc.php | 2 +- .../application/opensips_memory.inc.php | 2 +- .../graphs/application/powerdns_fail.inc.php | 2 +- .../application/powerdns_packetcache.inc.php | 2 +- .../application/powerdns_queries.inc.php | 2 +- .../application/powerdns_queries_udp.inc.php | 2 +- .../application/powerdns_querycache.inc.php | 2 +- .../application/powerdns_recursing.inc.php | 2 +- .../polling/applications/nfs-server.inc.php | 2 +- .../polling/applications/portactivity.inc.php | 2 +- tests/SmokepingCliTest.php | 48 +++++----- 21 files changed, 97 insertions(+), 97 deletions(-) diff --git a/app/Http/Controllers/Maps/MapController.php b/app/Http/Controllers/Maps/MapController.php index 732eb5302a..693d7c39c8 100644 --- a/app/Http/Controllers/Maps/MapController.php +++ b/app/Http/Controllers/Maps/MapController.php @@ -42,8 +42,8 @@ class MapController extends Controller ], 'border' => Config::get('network_map_legend.di.border'), 'background' => Config::get('network_map_legend.di.node'), - ], - ]; + ], + ]; } protected function nodeHighlightStyle() @@ -53,9 +53,9 @@ class MapController extends Controller 'border' => Config::get('network_map_legend.highlight.border'), ], 'border' => Config::get('network_map_legend.highlight.border'), - ], - 'borderWidth' => Config::get('network_map_legend.highlight.borderWidth'), - ]; + ], + 'borderWidth' => Config::get('network_map_legend.highlight.borderWidth'), + ]; } protected function nodeDownStyle() @@ -67,8 +67,8 @@ class MapController extends Controller ], 'border' => Config::get('network_map_legend.dn.border'), 'background' => Config::get('network_map_legend.dn.node'), - ], - ]; + ], + ]; } protected function nodeUpStyle() diff --git a/config/auth.php b/config/auth.php index a2073c229e..36263f50e8 100644 --- a/config/auth.php +++ b/config/auth.php @@ -85,10 +85,10 @@ return [ 'model' => App\Models\User::class, ], - 'legacy' => [ - 'driver' => 'legacy', - 'model' => App\Models\User::class, - ], + 'legacy' => [ + 'driver' => 'legacy', + 'model' => App\Models\User::class, + ], // 'users' => [ // 'driver' => 'database', diff --git a/includes/html/graphs/application/backupninja_backupninja.inc.php b/includes/html/graphs/application/backupninja_backupninja.inc.php index 2db0aef6ef..c881ed60d9 100644 --- a/includes/html/graphs/application/backupninja_backupninja.inc.php +++ b/includes/html/graphs/application/backupninja_backupninja.inc.php @@ -21,7 +21,7 @@ $array = [ 'descr' => 'last_warning', 'colour' => '0080C0', ], - ]; +]; $i = 0; if (rrdtool_check_rrd_exists($rrd_filename)) { diff --git a/includes/html/graphs/application/freeswitch_callsIn.inc.php b/includes/html/graphs/application/freeswitch_callsIn.inc.php index e3817b7967..1e91d934af 100644 --- a/includes/html/graphs/application/freeswitch_callsIn.inc.php +++ b/includes/html/graphs/application/freeswitch_callsIn.inc.php @@ -16,7 +16,7 @@ $array = [ 'descr' => 'Failed', 'colour' => '880000FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/freeswitch_callsOut.inc.php b/includes/html/graphs/application/freeswitch_callsOut.inc.php index f28f3923a8..e2d8a3cb61 100644 --- a/includes/html/graphs/application/freeswitch_callsOut.inc.php +++ b/includes/html/graphs/application/freeswitch_callsOut.inc.php @@ -16,7 +16,7 @@ $array = [ 'descr' => 'Failed', 'colour' => '880000FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/mailscanner_spam.inc.php b/includes/html/graphs/application/mailscanner_spam.inc.php index e6e74f5f2a..b575dd9917 100644 --- a/includes/html/graphs/application/mailscanner_spam.inc.php +++ b/includes/html/graphs/application/mailscanner_spam.inc.php @@ -15,7 +15,7 @@ $array = [ 'descr' => 'Virus', 'colour' => 'FF0000', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/mysql_connections.inc.php b/includes/html/graphs/application/mysql_connections.inc.php index 32ff480370..9815302ff4 100644 --- a/includes/html/graphs/application/mysql_connections.inc.php +++ b/includes/html/graphs/application/mysql_connections.inc.php @@ -30,7 +30,7 @@ $array = [ 'descr' => 'New Connections', 'colour' => '0080C0', ], - ]; +]; $i = 0; if (rrdtool_check_rrd_exists($rrd_filename)) { diff --git a/includes/html/graphs/application/nfs-server_stats_v4.inc.php b/includes/html/graphs/application/nfs-server_stats_v4.inc.php index 6ace07924d..095e4d8946 100644 --- a/includes/html/graphs/application/nfs-server_stats_v4.inc.php +++ b/includes/html/graphs/application/nfs-server_stats_v4.inc.php @@ -30,7 +30,7 @@ $rrd_filename = rrd_name($device['hostname'], ['app', 'nfs-server-proc4', $app[' $array = [ 'proc4_null' => ['descr' => 'Null', 'colour' => '630606'], // these should be very low 'proc4_compound' => ['descr' => 'Compound', 'colour' => '50C150'], // basically this are 1 or more ops - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/nfs-stats.inc.php b/includes/html/graphs/application/nfs-stats.inc.php index 53da9da558..d1a1a37f70 100644 --- a/includes/html/graphs/application/nfs-stats.inc.php +++ b/includes/html/graphs/application/nfs-stats.inc.php @@ -27,51 +27,51 @@ $array = [ 'descr' => 'Set attributes', 'colour' => '4D65A2', ], - 'lookup' => [ - 'descr' => 'Lookup', - 'colour' => '8B64A1', - ], - 'access' => [ - 'descr' => 'Access', - 'colour' => 'AAAA39', - ], - 'read' => [ - 'descr' => 'Read', - 'colour' => '', - ], - 'write' => [ - 'descr' => 'Write', - 'colour' => '457A9A', - ], - 'create' => [ - 'descr' => 'Create', - 'colour' => '690D87', - ], - 'mkdir' => [ - 'descr' => 'Make dir', - 'colour' => '072A3F', - ], - 'remove' => [ - 'descr' => 'Remove', - 'colour' => 'F16464', - ], - 'rmdir' => [ - 'descr' => 'Remove dir', - 'colour' => '57162D', - ], - 'rename' => [ - 'descr' => 'Rename', - 'colour' => 'A40B62', - ], - 'readdirplus' => [ - 'descr' => 'Read dir plus', - 'colour' => 'F1F164', - ], - 'fsstat' => [ - 'descr' => 'FS stat', - 'colour' => 'F1F191', - ], - ]; + 'lookup' => [ + 'descr' => 'Lookup', + 'colour' => '8B64A1', + ], + 'access' => [ + 'descr' => 'Access', + 'colour' => 'AAAA39', + ], + 'read' => [ + 'descr' => 'Read', + 'colour' => '', + ], + 'write' => [ + 'descr' => 'Write', + 'colour' => '457A9A', + ], + 'create' => [ + 'descr' => 'Create', + 'colour' => '690D87', + ], + 'mkdir' => [ + 'descr' => 'Make dir', + 'colour' => '072A3F', + ], + 'remove' => [ + 'descr' => 'Remove', + 'colour' => 'F16464', + ], + 'rmdir' => [ + 'descr' => 'Remove dir', + 'colour' => '57162D', + ], + 'rename' => [ + 'descr' => 'Rename', + 'colour' => 'A40B62', + ], + 'readdirplus' => [ + 'descr' => 'Read dir plus', + 'colour' => 'F1F164', + ], + 'fsstat' => [ + 'descr' => 'FS stat', + 'colour' => 'F1F191', + ], +]; $i = 0; diff --git a/includes/html/graphs/application/nfs-v3-stats_stats.inc.php b/includes/html/graphs/application/nfs-v3-stats_stats.inc.php index 00f7738e6d..8e50f57953 100644 --- a/includes/html/graphs/application/nfs-v3-stats_stats.inc.php +++ b/includes/html/graphs/application/nfs-v3-stats_stats.inc.php @@ -35,7 +35,7 @@ $array = [ 'proc3_fsinfo' => ['descr' => 'FS info', 'colour' => '6E2770'], 'proc3_pathconf' => ['descr' => 'Pathconf', 'colour' => '993555'], 'proc3_commit' => ['descr' => 'Commit', 'colour' => '463176'], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/nginx_connections.inc.php b/includes/html/graphs/application/nginx_connections.inc.php index 3ecedf6300..051ba7f665 100644 --- a/includes/html/graphs/application/nginx_connections.inc.php +++ b/includes/html/graphs/application/nginx_connections.inc.php @@ -23,7 +23,7 @@ $array = [ 'descr' => 'Starting', 'colour' => '157419FF', ], - ]; +]; $i = 0; if (rrdtool_check_rrd_exists($rrd_filename)) { diff --git a/includes/html/graphs/application/opensips_memory.inc.php b/includes/html/graphs/application/opensips_memory.inc.php index 453a504e97..d1c153ec57 100644 --- a/includes/html/graphs/application/opensips_memory.inc.php +++ b/includes/html/graphs/application/opensips_memory.inc.php @@ -14,7 +14,7 @@ $array = [ 'descr' => 'Used', 'colour' => '0022FF', ], - ]; +]; $i = 0; if (rrdtool_check_rrd_exists($rrd_filename)) { diff --git a/includes/html/graphs/application/powerdns_fail.inc.php b/includes/html/graphs/application/powerdns_fail.inc.php index 7a0b35b913..c111e98ac5 100644 --- a/includes/html/graphs/application/powerdns_fail.inc.php +++ b/includes/html/graphs/application/powerdns_fail.inc.php @@ -20,7 +20,7 @@ $array = [ 'descr' => 'Timedout', 'colour' => 'FFFF00FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/powerdns_packetcache.inc.php b/includes/html/graphs/application/powerdns_packetcache.inc.php index 6223dd749d..a25957ccd5 100644 --- a/includes/html/graphs/application/powerdns_packetcache.inc.php +++ b/includes/html/graphs/application/powerdns_packetcache.inc.php @@ -20,7 +20,7 @@ $array = [ 'descr' => 'Size', 'colour' => '006699FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/powerdns_queries.inc.php b/includes/html/graphs/application/powerdns_queries.inc.php index 00fd85b818..485be9e9c9 100644 --- a/includes/html/graphs/application/powerdns_queries.inc.php +++ b/includes/html/graphs/application/powerdns_queries.inc.php @@ -24,7 +24,7 @@ $array = [ 'descr' => 'UDP Queries', 'colour' => '6699CCFF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/powerdns_queries_udp.inc.php b/includes/html/graphs/application/powerdns_queries_udp.inc.php index 2e141b7393..4418ca0593 100644 --- a/includes/html/graphs/application/powerdns_queries_udp.inc.php +++ b/includes/html/graphs/application/powerdns_queries_udp.inc.php @@ -24,7 +24,7 @@ $array = [ 'descr' => 'UDP6 Queries', 'colour' => '880000FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/powerdns_querycache.inc.php b/includes/html/graphs/application/powerdns_querycache.inc.php index 7bf417da2d..b8081a2b5f 100644 --- a/includes/html/graphs/application/powerdns_querycache.inc.php +++ b/includes/html/graphs/application/powerdns_querycache.inc.php @@ -16,7 +16,7 @@ $array = [ 'descr' => 'Hits', 'colour' => '00FF00FF', ], - ]; +]; $i = 0; diff --git a/includes/html/graphs/application/powerdns_recursing.inc.php b/includes/html/graphs/application/powerdns_recursing.inc.php index 0a7045c8f8..1a920c4d77 100644 --- a/includes/html/graphs/application/powerdns_recursing.inc.php +++ b/includes/html/graphs/application/powerdns_recursing.inc.php @@ -16,7 +16,7 @@ $array = [ 'descr' => 'Answers', 'colour' => '336699FF', ], - ]; +]; $i = 0; diff --git a/includes/polling/applications/nfs-server.inc.php b/includes/polling/applications/nfs-server.inc.php index b2edba6811..b6e89f5bcb 100644 --- a/includes/polling/applications/nfs-server.inc.php +++ b/includes/polling/applications/nfs-server.inc.php @@ -223,7 +223,7 @@ $keys_nfs_server = [ 'v4_getdirdeleg', 'v4_getdevinfo', 'v4_getdevlist', 'v4_layoutcommit', 'v4_layoutget', 'v4_layoutreturn', 'v4_secinfononam', 'v4_sequence', 'v4_set_ssv', 'v4_test_stateid', 'v4_want_deleg', 'v4_destroy_clid', 'v4_reclaim_comp', ], - ]; +]; // parse each output line, by the id // then 'map' the values to the arrays from $keys_nfs_server diff --git a/includes/polling/applications/portactivity.inc.php b/includes/polling/applications/portactivity.inc.php index a17f62b753..a7936984d1 100644 --- a/includes/polling/applications/portactivity.inc.php +++ b/includes/polling/applications/portactivity.inc.php @@ -129,7 +129,7 @@ $options = [ 'filter' => [ 'device_id' => ['=', $device_id], 'type' => ['=', 'portsactivity'], - ], + ], ]; $component = new LibreNMS\Component(); diff --git a/tests/SmokepingCliTest.php b/tests/SmokepingCliTest.php index 16aabaa64e..e36025a3ad 100644 --- a/tests/SmokepingCliTest.php +++ b/tests/SmokepingCliTest.php @@ -51,33 +51,33 @@ class SmokepingCliTest extends DBTestCase '2600::' => [ 'transport' => 'udp', ], + ], + 'Psv9oZcxdC' => [ + 'oHiPfLzrmU' => [ + 'transport' => 'udp', ], - 'Psv9oZcxdC' => [ - 'oHiPfLzrmU' => [ - 'transport' => 'udp', - ], - 'kEn7hZ7N37' => [ - 'transport' => 'udp6', - ], - 'PcbZ5FKtS3' => [ - 'transport' => 'udp6', - ], - '192.168.1.1' => [ - 'transport' => 'udp', - ], - 'fe80::' => [ - 'transport' => 'udp', - ], + 'kEn7hZ7N37' => [ + 'transport' => 'udp6', ], - '4diY0pWFik' => [ - 'example.org' => [ - 'transport' => 'udp', - ], - 'host_with_under_score.example.org' => [ - 'transport' => 'udp6', - ], + 'PcbZ5FKtS3' => [ + 'transport' => 'udp6', ], - ]; + '192.168.1.1' => [ + 'transport' => 'udp', + ], + 'fe80::' => [ + 'transport' => 'udp', + ], + ], + '4diY0pWFik' => [ + 'example.org' => [ + 'transport' => 'udp', + ], + 'host_with_under_score.example.org' => [ + 'transport' => 'udp6', + ], + ], + ]; private $instance = null;