Fix more PHPDoc (#12665)

* Fix PHPDoc

* Fix PHPDoc
This commit is contained in:
Jellyfrog
2021-03-28 19:18:47 +02:00
committed by GitHub
parent 9946fe8b15
commit efb157f5fb
35 changed files with 47 additions and 54 deletions

View File

@@ -36,8 +36,8 @@ use LibreNMS\Alerting\QueryBuilderParser;
class AlertDB class AlertDB
{ {
/** /**
* @param $rule * @param string $rule
* @param $query_builder * @param bool $query_builder
* @return bool|string * @return bool|string
*/ */
public static function genSQL($rule, $query_builder = false) public static function genSQL($rule, $query_builder = false)

View File

@@ -35,7 +35,7 @@ class AlertUtil
/** /**
* Get the rule_id for a specific alert * Get the rule_id for a specific alert
* *
* @param $alert_id * @param int $alert_id
* @return mixed|null * @return mixed|null
*/ */
private static function getRuleId($alert_id) private static function getRuleId($alert_id)
@@ -48,7 +48,7 @@ class AlertUtil
/** /**
* Get the transport for a given alert_id * Get the transport for a given alert_id
* *
* @param $alert_id * @param int $alert_id
* @return array * @return array
*/ */
public static function getAlertTransports($alert_id) public static function getAlertTransports($alert_id)

View File

@@ -66,7 +66,7 @@ class Template
/** /**
* Parse Blade body * Parse Blade body
* *
* @param $data * @param array $data
* @return string * @return string
*/ */
public function bladeBody($data) public function bladeBody($data)
@@ -82,7 +82,7 @@ class Template
/** /**
* Parse Blade title * Parse Blade title
* *
* @param $data * @param array $data
* @return string * @return string
*/ */
public function bladeTitle($data) public function bladeTitle($data)

View File

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

View File

@@ -50,7 +50,6 @@ class DatabaseConnectException extends \Exception implements UpgradeableExceptio
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -44,7 +44,6 @@ class DuskUnsafeException extends \Exception implements UpgradeableException
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -62,7 +62,6 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)
@@ -79,9 +78,7 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
} }
/** /**
* @param \Illuminate\Config\Repository $user * @param string $log_file
* @param \Illuminate\Config\Repository $group
* @param $log_file
* @return array * @return array
*/ */
private function generateCommands($log_file): array private function generateCommands($log_file): array

View File

@@ -39,7 +39,6 @@ class FileWriteFailedException extends \Exception
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -40,7 +40,7 @@ class HostUnreachableException extends \Exception
/** /**
* Add additional reasons * Add additional reasons
* @param $message * @param string $message
*/ */
public function addReason($message) public function addReason($message)
{ {

View File

@@ -39,7 +39,6 @@ class LdapMissingException extends AuthenticationException
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -50,7 +50,6 @@ class MaximumExecutionTimeExceeded extends \Exception implements UpgradeableExce
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -61,7 +61,6 @@ class UnserializableRouteCache extends \Exception implements UpgradeableExceptio
/** /**
* Render the exception into an HTTP or JSON response. * Render the exception into an HTTP or JSON response.
* *
* @param \Illuminate\Http\Request
* @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
*/ */
public function render(\Illuminate\Http\Request $request) public function render(\Illuminate\Http\Request $request)

View File

@@ -29,8 +29,8 @@ interface Transport
/** /**
* Gets called when an alert is sent * Gets called when an alert is sent
* *
* @param $alert_data array An array created by DescribeAlert * @param array $alert_data An array created by DescribeAlert
* @param $opts array|true The options from the alert_transports transport_config column * @param array|true $opts The options from the alert_transports transport_config column
* @return mixed Returns if the call was successful * @return mixed Returns if the call was successful
*/ */
public function deliverAlert($alert_data, $opts); public function deliverAlert($alert_data, $opts);

View File

@@ -28,7 +28,7 @@ interface Keyable
{ {
/** /**
* Get a string that can identify a unique instance of this model * Get a string that can identify a unique instance of this model
* @return string * @return string|int
*/ */
public function getCompositeKey(); public function getCompositeKey();
} }

View File

@@ -163,7 +163,7 @@ class OS implements ProcessorDiscovery, OSDiscovery, MempoolsDiscovery
* *
* @param string $oid textual oid * @param string $oid textual oid
* @param string $mib mib for this oid (optional) * @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 * @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) 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 * Check if an OID has been cached
* *
* @param $oid * @param string $oid
* @return bool * @return bool
*/ */
public function isCached($oid) public function isCached($oid)

View File

@@ -94,8 +94,8 @@ class Timos extends OS implements MplsDiscovery, MplsPolling, WirelessPowerDisco
} }
/** /**
* @param tmnxEnacpVal * @param mixed $tmnxEnacpVal
* @return encapsulation string * @return string encapsulation
* see TIMETRA-TC-MIB::TmnxEncapVal * see TIMETRA-TC-MIB::TmnxEncapVal
*/ */
private function nokiaEncap($tmnxEncapVal) private function nokiaEncap($tmnxEncapVal)

View File

@@ -79,7 +79,7 @@ trait VxworksProcessorUsage
* Parse the silly cpu usage string * Parse the silly cpu usage string
* " 5 Secs ( 96.4918%) 60 Secs ( 54.2271%) 300 Secs ( 38.2591%)" * " 5 Secs ( 96.4918%) 60 Secs ( 54.2271%) 300 Secs ( 38.2591%)"
* *
* @param $data * @param string $data
* @return mixed * @return mixed
*/ */
private function parseCpuUsage($data) private function parseCpuUsage($data)

View File

@@ -278,6 +278,7 @@ class Proc
/** /**
* If this process waits for output * If this process waits for output
*
* @return bool * @return bool
*/ */
public function isSynchronous() public function isSynchronous()
@@ -301,7 +302,7 @@ class Proc
* Add and end of line character to a string if * Add and end of line character to a string if
* it doesn't already end with one * it doesn't already end with one
* *
* @param $string * @param string $string
* @return string * @return string
*/ */
private function checkAddEOL($string) private function checkAddEOL($string)

View File

@@ -85,7 +85,7 @@ class RrdDefinition
/** /**
* Check if the give dataset name is valid for this definition * Check if the give dataset name is valid for this definition
* *
* @param $name * @param string $name
* @return bool * @return bool
*/ */
public function isValidDataset($name) public function isValidDataset($name)

View File

@@ -42,7 +42,7 @@ class Trap
/** /**
* Construct a trap from raw trap text * Construct a trap from raw trap text
* @param $trap * @param string $trap
*/ */
public function __construct($trap) public function __construct($trap)
{ {
@@ -72,7 +72,7 @@ class Trap
/** /**
* Find the first in this trap by substring * Find the first in this trap by substring
* *
* @param $search * @param string|string[] $search
* @return string * @return string
*/ */
public function findOid($search) public function findOid($search)
@@ -84,7 +84,7 @@ class Trap
/** /**
* Find all oids that match the given string * Find all oids that match the given string
* @param $search * @param string|string[] $search
* @return array * @return array
*/ */
public function findOids($search) public function findOids($search)
@@ -146,7 +146,7 @@ class Trap
/** /**
* Render the Trap for debugging purpose * Render the Trap for debugging purpose
* *
* @param $detailed * @param bool $detailed
* @return string * @return string
*/ */
public function toString($detailed = false) public function toString($detailed = false)

View File

@@ -68,7 +68,7 @@ class Clean
* Clean a string for display in an html page. * Clean a string for display in an html page.
* For use in non-blade pages * For use in non-blade pages
* *
* @param $value * @param string $value
* @param array $purifier_config (key, value pair) * @param array $purifier_config (key, value pair)
* @return string * @return string
*/ */

View File

@@ -58,7 +58,7 @@ class DynamicConfigItem implements \ArrayAccess
/** /**
* Check given value is valid. Using the type of this config item and possibly other variables. * Check given value is valid. Using the type of this config item and possibly other variables.
* *
* @param $value * @param mixed $value
* @return bool|mixed * @return bool|mixed
*/ */
public function checkValue($value) public function checkValue($value)

View File

@@ -161,7 +161,7 @@ class EnvHelper
/** /**
* quote strings with spaces * quote strings with spaces
* *
* @param $value * @param string $value
* @return string * @return string
*/ */
private static function escapeValue($value) private static function escapeValue($value)

View File

@@ -105,7 +105,7 @@ class GitHub
/** /**
* Get the release information for a specific tag * Get the release information for a specific tag
* *
* @param $tag * @param string $tag
* @return mixed * @return mixed
*/ */
public function getRelease($tag) public function getRelease($tag)
@@ -127,7 +127,7 @@ class GitHub
/** /**
* Get all closed pull requests up to a certain date * Get all closed pull requests up to a certain date
* *
* @param $date * @param string $date
* @param string $after * @param string $after
*/ */
public function getPullRequests($date, $after = null) public function getPullRequests($date, $after = null)
@@ -307,7 +307,7 @@ GRAPHQL;
/** /**
* Create a markdown list of users and link their github profile * Create a markdown list of users and link their github profile
* @param $users * @param array $users
* @return string * @return string
*/ */
private function formatUserList($users) private function formatUserList($users)

View File

@@ -36,7 +36,7 @@ class Graph
/** /**
* Get an array of all graph subtypes for the given type * Get an array of all graph subtypes for the given type
* @param $type * @param string $type
* @param Device $device * @param Device $device
* @return array * @return array
*/ */
@@ -73,8 +73,8 @@ class Graph
/** /**
* Check if the given graph is a mib graph * Check if the given graph is a mib graph
* *
* @param $type * @param string $type
* @param $subtype * @param string $subtype
* @return bool * @return bool
*/ */
public static function isMibGraph($type, $subtype) public static function isMibGraph($type, $subtype)

View File

@@ -30,7 +30,7 @@ class IPv4 extends IP
{ {
/** /**
* IPv4 constructor. * IPv4 constructor.
* @param $ipv4 * @param string $ipv4
* @throws InvalidIpException * @throws InvalidIpException
*/ */
public function __construct($ipv4) public function __construct($ipv4)

View File

@@ -30,7 +30,7 @@ class IPv6 extends IP
{ {
/** /**
* IPv6 constructor. * IPv6 constructor.
* @param $ipv6 * @param string $ipv6
* @throws InvalidIpException * @throws InvalidIpException
*/ */
public function __construct($ipv6) public function __construct($ipv6)

View File

@@ -130,8 +130,8 @@ class Laravel
/** /**
* Add prefix and strip .php to make the url helper work in non-laravel php scripts * Add prefix and strip .php to make the url helper work in non-laravel php scripts
* *
* @param $request * @param \Illuminate\Http\Request $request
* @param $auth * @param bool $auth
*/ */
private static function rewriteDummyHeaders($request, $auth) private static function rewriteDummyHeaders($request, $auth)
{ {

View File

@@ -667,7 +667,7 @@ class ModuleTestHelper
* Mostly used for testing * Mostly used for testing
* *
* @param int $device_id The test device id * @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) * @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 * @return array The dumped data keyed by module -> table
*/ */

View File

@@ -114,7 +114,7 @@ class Rewrite
/** /**
* Reformat a mac stored in the DB (only hex) to a nice readable format * Reformat a mac stored in the DB (only hex) to a nice readable format
* *
* @param $mac * @param string $mac
* @return string * @return string
*/ */
public static function readableMac($mac) public static function readableMac($mac)

View File

@@ -29,7 +29,7 @@ class StringHelpers
/** /**
* Shorten text over 50 chars, if shortened, add ellipsis * Shorten text over 50 chars, if shortened, add ellipsis
* *
* @param $string * @param string $string
* @param int $max * @param int $max
* @return string * @return string
*/ */
@@ -84,7 +84,7 @@ class StringHelpers
/** /**
* Convert a camel or studly case string to Title case (with spaces) * Convert a camel or studly case string to Title case (with spaces)
* @param $string * @param string $string
* @return string * @return string
*/ */
public static function camelToTitle($string) public static function camelToTitle($string)

View File

@@ -10,7 +10,7 @@ class Authenticate extends Middleware
* Get the path the user should be redirected to when they are not authenticated. * Get the path the user should be redirected to when they are not authenticated.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return string|null * @return string|void
*/ */
protected function redirectTo($request) protected function redirectTo($request)
{ {

View File

@@ -30,7 +30,7 @@ class MplsSdp extends Model implements Keyable
/** /**
* Get a string that can identify a unique instance of this model * Get a string that can identify a unique instance of this model
* @return string * @return int
*/ */
public function getCompositeKey() public function getCompositeKey()
{ {

View File

@@ -35,7 +35,8 @@ class MplsService extends Model implements Keyable
/** /**
* Get a string that can identify a unique instance of this model * Get a string that can identify a unique instance of this model
* @return string *
* @return int
*/ */
public function getCompositeKey() public function getCompositeKey()
{ {

View File

@@ -115,7 +115,7 @@ class Notification extends Model
/** /**
* @param Builder<Notification> $query * @param Builder<Notification> $query
* @return $this * @return Builder<Notification>
*/ */
public function scopeLimit(Builder $query) public function scopeLimit(Builder $query)
{ {