mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -36,8 +36,8 @@ use LibreNMS\Alerting\QueryBuilderParser;
|
||||
class AlertDB
|
||||
{
|
||||
/**
|
||||
* @param $rule
|
||||
* @param $query_builder
|
||||
* @param string $rule
|
||||
* @param bool $query_builder
|
||||
* @return bool|string
|
||||
*/
|
||||
public static function genSQL($rule, $query_builder = false)
|
||||
|
@@ -35,7 +35,7 @@ class AlertUtil
|
||||
/**
|
||||
* Get the rule_id for a specific alert
|
||||
*
|
||||
* @param $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 $alert_id
|
||||
* @param int $alert_id
|
||||
* @return array
|
||||
*/
|
||||
public static function getAlertTransports($alert_id)
|
||||
|
@@ -66,7 +66,7 @@ class Template
|
||||
/**
|
||||
* Parse Blade body
|
||||
*
|
||||
* @param $data
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
public function bladeBody($data)
|
||||
@@ -82,7 +82,7 @@ class Template
|
||||
/**
|
||||
* Parse Blade title
|
||||
*
|
||||
* @param $data
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
public function bladeTitle($data)
|
||||
|
@@ -48,8 +48,8 @@ class Pagerduty extends Transport
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $obj
|
||||
* @param $config
|
||||
* @param array $obj
|
||||
* @param array $config
|
||||
* @return bool|string
|
||||
*/
|
||||
public function contactPagerduty($obj, $config)
|
||||
|
@@ -50,7 +50,6 @@ class DatabaseConnectException extends \Exception implements UpgradeableExceptio
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -44,7 +44,6 @@ class DuskUnsafeException extends \Exception implements UpgradeableException
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -62,7 +62,6 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
@@ -79,9 +78,7 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Illuminate\Config\Repository $user
|
||||
* @param \Illuminate\Config\Repository $group
|
||||
* @param $log_file
|
||||
* @param string $log_file
|
||||
* @return array
|
||||
*/
|
||||
private function generateCommands($log_file): array
|
||||
|
@@ -39,7 +39,6 @@ class FileWriteFailedException extends \Exception
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -40,7 +40,7 @@ class HostUnreachableException extends \Exception
|
||||
|
||||
/**
|
||||
* Add additional reasons
|
||||
* @param $message
|
||||
* @param string $message
|
||||
*/
|
||||
public function addReason($message)
|
||||
{
|
||||
|
@@ -39,7 +39,6 @@ class LdapMissingException extends AuthenticationException
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -50,7 +50,6 @@ class MaximumExecutionTimeExceeded extends \Exception implements UpgradeableExce
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -61,7 +61,6 @@ class UnserializableRouteCache extends \Exception implements UpgradeableExceptio
|
||||
/**
|
||||
* Render the exception into an HTTP or JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
|
@@ -29,8 +29,8 @@ interface Transport
|
||||
/**
|
||||
* Gets called when an alert is sent
|
||||
*
|
||||
* @param $alert_data array An array created by DescribeAlert
|
||||
* @param $opts array|true The options from the alert_transports transport_config column
|
||||
* @param array $alert_data An array created by DescribeAlert
|
||||
* @param array|true $opts The options from the alert_transports transport_config column
|
||||
* @return mixed Returns if the call was successful
|
||||
*/
|
||||
public function deliverAlert($alert_data, $opts);
|
||||
|
@@ -28,7 +28,7 @@ interface Keyable
|
||||
{
|
||||
/**
|
||||
* Get a string that can identify a unique instance of this model
|
||||
* @return string
|
||||
* @return string|int
|
||||
*/
|
||||
public function getCompositeKey();
|
||||
}
|
||||
|
@@ -163,7 +163,7 @@ class OS implements ProcessorDiscovery, OSDiscovery, MempoolsDiscovery
|
||||
*
|
||||
* @param string $oid textual oid
|
||||
* @param string $mib mib for this oid (optional)
|
||||
* @param string $depth depth for snmpwalk_group (optional)
|
||||
* @param int $depth depth for snmpwalk_group (optional)
|
||||
* @return array array indexed by the snmp index with the value as the data returned by snmp
|
||||
*/
|
||||
public function getCacheTable($oid, $mib = null, $depth = 1)
|
||||
@@ -184,7 +184,7 @@ class OS implements ProcessorDiscovery, OSDiscovery, MempoolsDiscovery
|
||||
/**
|
||||
* Check if an OID has been cached
|
||||
*
|
||||
* @param $oid
|
||||
* @param string $oid
|
||||
* @return bool
|
||||
*/
|
||||
public function isCached($oid)
|
||||
|
@@ -94,8 +94,8 @@ class Timos extends OS implements MplsDiscovery, MplsPolling, WirelessPowerDisco
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tmnxEnacpVal
|
||||
* @return encapsulation string
|
||||
* @param mixed $tmnxEnacpVal
|
||||
* @return string encapsulation
|
||||
* see TIMETRA-TC-MIB::TmnxEncapVal
|
||||
*/
|
||||
private function nokiaEncap($tmnxEncapVal)
|
||||
|
@@ -79,7 +79,7 @@ trait VxworksProcessorUsage
|
||||
* Parse the silly cpu usage string
|
||||
* " 5 Secs ( 96.4918%) 60 Secs ( 54.2271%) 300 Secs ( 38.2591%)"
|
||||
*
|
||||
* @param $data
|
||||
* @param string $data
|
||||
* @return mixed
|
||||
*/
|
||||
private function parseCpuUsage($data)
|
||||
|
@@ -278,6 +278,7 @@ class Proc
|
||||
|
||||
/**
|
||||
* If this process waits for output
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSynchronous()
|
||||
@@ -301,7 +302,7 @@ class Proc
|
||||
* Add and end of line character to a string if
|
||||
* it doesn't already end with one
|
||||
*
|
||||
* @param $string
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
private function checkAddEOL($string)
|
||||
|
@@ -85,7 +85,7 @@ class RrdDefinition
|
||||
/**
|
||||
* Check if the give dataset name is valid for this definition
|
||||
*
|
||||
* @param $name
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidDataset($name)
|
||||
|
@@ -42,7 +42,7 @@ class Trap
|
||||
|
||||
/**
|
||||
* Construct a trap from raw trap text
|
||||
* @param $trap
|
||||
* @param string $trap
|
||||
*/
|
||||
public function __construct($trap)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ class Trap
|
||||
/**
|
||||
* Find the first in this trap by substring
|
||||
*
|
||||
* @param $search
|
||||
* @param string|string[] $search
|
||||
* @return string
|
||||
*/
|
||||
public function findOid($search)
|
||||
@@ -84,7 +84,7 @@ class Trap
|
||||
|
||||
/**
|
||||
* Find all oids that match the given string
|
||||
* @param $search
|
||||
* @param string|string[] $search
|
||||
* @return array
|
||||
*/
|
||||
public function findOids($search)
|
||||
@@ -146,7 +146,7 @@ class Trap
|
||||
/**
|
||||
* Render the Trap for debugging purpose
|
||||
*
|
||||
* @param $detailed
|
||||
* @param bool $detailed
|
||||
* @return string
|
||||
*/
|
||||
public function toString($detailed = false)
|
||||
|
@@ -68,7 +68,7 @@ class Clean
|
||||
* Clean a string for display in an html page.
|
||||
* For use in non-blade pages
|
||||
*
|
||||
* @param $value
|
||||
* @param string $value
|
||||
* @param array $purifier_config (key, value pair)
|
||||
* @return string
|
||||
*/
|
||||
|
@@ -58,7 +58,7 @@ class DynamicConfigItem implements \ArrayAccess
|
||||
/**
|
||||
* Check given value is valid. Using the type of this config item and possibly other variables.
|
||||
*
|
||||
* @param $value
|
||||
* @param mixed $value
|
||||
* @return bool|mixed
|
||||
*/
|
||||
public function checkValue($value)
|
||||
|
@@ -161,7 +161,7 @@ class EnvHelper
|
||||
/**
|
||||
* quote strings with spaces
|
||||
*
|
||||
* @param $value
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
private static function escapeValue($value)
|
||||
|
@@ -105,7 +105,7 @@ class GitHub
|
||||
/**
|
||||
* Get the release information for a specific tag
|
||||
*
|
||||
* @param $tag
|
||||
* @param string $tag
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRelease($tag)
|
||||
@@ -127,7 +127,7 @@ class GitHub
|
||||
/**
|
||||
* Get all closed pull requests up to a certain date
|
||||
*
|
||||
* @param $date
|
||||
* @param string $date
|
||||
* @param string $after
|
||||
*/
|
||||
public function getPullRequests($date, $after = null)
|
||||
@@ -307,7 +307,7 @@ GRAPHQL;
|
||||
|
||||
/**
|
||||
* Create a markdown list of users and link their github profile
|
||||
* @param $users
|
||||
* @param array $users
|
||||
* @return string
|
||||
*/
|
||||
private function formatUserList($users)
|
||||
|
@@ -36,7 +36,7 @@ class Graph
|
||||
|
||||
/**
|
||||
* Get an array of all graph subtypes for the given type
|
||||
* @param $type
|
||||
* @param string $type
|
||||
* @param Device $device
|
||||
* @return array
|
||||
*/
|
||||
@@ -73,8 +73,8 @@ class Graph
|
||||
/**
|
||||
* Check if the given graph is a mib graph
|
||||
*
|
||||
* @param $type
|
||||
* @param $subtype
|
||||
* @param string $type
|
||||
* @param string $subtype
|
||||
* @return bool
|
||||
*/
|
||||
public static function isMibGraph($type, $subtype)
|
||||
|
@@ -30,7 +30,7 @@ class IPv4 extends IP
|
||||
{
|
||||
/**
|
||||
* IPv4 constructor.
|
||||
* @param $ipv4
|
||||
* @param string $ipv4
|
||||
* @throws InvalidIpException
|
||||
*/
|
||||
public function __construct($ipv4)
|
||||
|
@@ -30,7 +30,7 @@ class IPv6 extends IP
|
||||
{
|
||||
/**
|
||||
* IPv6 constructor.
|
||||
* @param $ipv6
|
||||
* @param string $ipv6
|
||||
* @throws InvalidIpException
|
||||
*/
|
||||
public function __construct($ipv6)
|
||||
|
@@ -130,8 +130,8 @@ class Laravel
|
||||
/**
|
||||
* Add prefix and strip .php to make the url helper work in non-laravel php scripts
|
||||
*
|
||||
* @param $request
|
||||
* @param $auth
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param bool $auth
|
||||
*/
|
||||
private static function rewriteDummyHeaders($request, $auth)
|
||||
{
|
||||
|
@@ -667,7 +667,7 @@ class ModuleTestHelper
|
||||
* Mostly used for testing
|
||||
*
|
||||
* @param int $device_id The test device id
|
||||
* @param array modules to capture data for (should be a list of modules that were actually run)
|
||||
* @param array $modules to capture data for (should be a list of modules that were actually run)
|
||||
* @param string $key a key to store the data under the module key (usually discovery or poller)
|
||||
* @return array The dumped data keyed by module -> table
|
||||
*/
|
||||
|
@@ -114,7 +114,7 @@ class Rewrite
|
||||
/**
|
||||
* Reformat a mac stored in the DB (only hex) to a nice readable format
|
||||
*
|
||||
* @param $mac
|
||||
* @param string $mac
|
||||
* @return string
|
||||
*/
|
||||
public static function readableMac($mac)
|
||||
|
@@ -29,7 +29,7 @@ class StringHelpers
|
||||
/**
|
||||
* Shorten text over 50 chars, if shortened, add ellipsis
|
||||
*
|
||||
* @param $string
|
||||
* @param string $string
|
||||
* @param int $max
|
||||
* @return string
|
||||
*/
|
||||
@@ -84,7 +84,7 @@ class StringHelpers
|
||||
|
||||
/**
|
||||
* Convert a camel or studly case string to Title case (with spaces)
|
||||
* @param $string
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
public static function camelToTitle($string)
|
||||
|
@@ -10,7 +10,7 @@ class Authenticate extends Middleware
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
* @return string|void
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ class MplsSdp extends Model implements Keyable
|
||||
|
||||
/**
|
||||
* Get a string that can identify a unique instance of this model
|
||||
* @return string
|
||||
* @return int
|
||||
*/
|
||||
public function getCompositeKey()
|
||||
{
|
||||
|
@@ -35,7 +35,8 @@ class MplsService extends Model implements Keyable
|
||||
|
||||
/**
|
||||
* Get a string that can identify a unique instance of this model
|
||||
* @return string
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCompositeKey()
|
||||
{
|
||||
|
@@ -115,7 +115,7 @@ class Notification extends Model
|
||||
|
||||
/**
|
||||
* @param Builder<Notification> $query
|
||||
* @return $this
|
||||
* @return Builder<Notification>
|
||||
*/
|
||||
public function scopeLimit(Builder $query)
|
||||
{
|
||||
|
Reference in New Issue
Block a user