Apply fixes from StyleCI (#13208)

This commit is contained in:
Jellyfrog
2021-09-08 23:35:56 +02:00
committed by GitHub
parent c6d2385c3a
commit 26b95c0ccc
370 changed files with 1667 additions and 1667 deletions

View File

@@ -36,8 +36,8 @@ use LibreNMS\Alerting\QueryBuilderParser;
class AlertDB
{
/**
* @param string $rule
* @param mixed $query_builder
* @param string $rule
* @param mixed $query_builder
* @return bool|string
*/
public static function genSQL($rule, $query_builder = false)
@@ -51,7 +51,7 @@ class AlertDB
/**
* Generate SQL from Rule
* @param string $rule Rule to generate SQL for
* @param string $rule Rule to generate SQL for
* @return string|bool
*/
public static function genSQLOld($rule)

View File

@@ -35,7 +35,7 @@ class AlertUtil
/**
* Get the rule_id for a specific alert
*
* @param int $alert_id
* @param int $alert_id
* @return mixed|null
*/
private static function getRuleId($alert_id)
@@ -48,7 +48,7 @@ class AlertUtil
/**
* Get the transport for a given alert_id
*
* @param int $alert_id
* @param int $alert_id
* @return array
*/
public static function getAlertTransports($alert_id)
@@ -73,7 +73,7 @@ class AlertUtil
/**
* Find contacts for alert
* @param array $results Rule-Result
* @param array $results Rule-Result
* @return array
*/
public static function getContacts($results)
@@ -193,7 +193,7 @@ class AlertUtil
/**
* Check if device is under maintenance
* @param int $device_id Device-ID
* @param int $device_id Device-ID
* @return bool
*/
public static function isMaintenance($device_id)
@@ -203,7 +203,7 @@ class AlertUtil
/**
* Check if device is set to ignore alerts
* @param int $device_id Device-ID
* @param int $device_id Device-ID
* @return bool
*/
public static function hasDisableNotify($device_id)
@@ -215,8 +215,8 @@ class AlertUtil
/**
* Process Macros
* @param string $rule Rule to process
* @param int $x Recursion-Anchor
* @param string $rule Rule to process
* @param int $x Recursion-Anchor
* @return string|bool
*/
public static function runMacros($rule, $x = 1)

View File

@@ -41,8 +41,8 @@ class RunAlerts
{
/**
* Populate variables
* @param string $txt Text with variables
* @param bool $wrap Wrap variable for text-usage (default: true)
* @param string $txt Text with variables
* @param bool $wrap Wrap variable for text-usage (default: true)
* @return string
*/
public function populate($txt, $wrap = true)
@@ -76,7 +76,7 @@ class RunAlerts
/**
* Describe Alert
* @param array $alert Alert-Result from DB
* @param array $alert Alert-Result from DB
* @return array|bool|string
*/
public function describeAlert($alert)
@@ -196,7 +196,7 @@ class RunAlerts
/**
* Format Elapsed Time
* @param int $secs Seconds elapsed
* @param int $secs Seconds elapsed
* @return string
*/
public function timeFormat($secs)
@@ -236,8 +236,8 @@ class RunAlerts
/**
* Re-Validate Rule-Mappings
* @param int $device_id Device-ID
* @param int $rule Rule-ID
* @param int $device_id Device-ID
* @param int $rule Rule-ID
* @return bool
*/
public function isRuleValid($device_id, $rule)
@@ -258,7 +258,7 @@ class RunAlerts
/**
* Issue Alert-Object
* @param array $alert
* @param array $alert
* @return bool
*/
public function issueAlert($alert)
@@ -488,7 +488,7 @@ class RunAlerts
/**
* Run external transports
* @param array $obj Alert-Array
* @param array $obj Alert-Array
* @return void
*/
public function extTransports($obj)
@@ -576,7 +576,7 @@ class RunAlerts
/**
* Check if a device's all parent are down
* Returns true if all parents are down
* @param int $device Device-ID
* @param int $device Device-ID
* @return bool
*/
public function isParentDown($device)

View File

@@ -34,7 +34,7 @@ class Template
/**
* Get the template details
*
* @param array|null $obj
* @param array|null $obj
* @return mixed
*/
public function getTemplate($obj = null)
@@ -66,7 +66,7 @@ class Template
/**
* Parse Blade body
*
* @param array $data
* @param array $data
* @return string
*/
public function bladeBody($data)
@@ -82,7 +82,7 @@ class Template
/**
* Parse Blade title
*
* @param array $data
* @param array $data
* @return string
*/
public function bladeTitle($data)

View File

@@ -13,7 +13,7 @@ abstract class Transport implements TransportInterface
/**
* Transport constructor.
* @param null $transport_id
* @param null $transport_id
*/
public function __construct($transport_id = null)
{
@@ -26,7 +26,7 @@ abstract class Transport implements TransportInterface
/**
* Helper function to parse free form text box defined in ini style to key value pairs
*
* @param string $input
* @param string $input
* @return array
*/
protected function parseUserOptions($input)
@@ -44,7 +44,7 @@ abstract class Transport implements TransportInterface
/**
* Get the hex color string for a particular state
* @param int $state State code from alert
* @param int $state State code from alert
* @return string Hex color, default to #337AB7 blue if state unrecognised
*/
public static function getColorForState($state)

View File

@@ -48,8 +48,8 @@ class Pagerduty extends Transport
}
/**
* @param array $obj
* @param array $config
* @param array $obj
* @param array $config
* @return bool|string
*/
public function contactPagerduty($obj, $config)