Skip to content

Commit

Permalink
Apply fixes from StyleCI (librenms#13224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jellyfrog committed Sep 10, 2021
1 parent ad52701 commit 258505e
Show file tree
Hide file tree
Showing 1,036 changed files with 1,269 additions and 19 deletions.
4 changes: 4 additions & 0 deletions LibreNMS/Alert/AlertDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
*
*
* Original code:
*
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
*
* Modified by:
*
* @link https://www.librenms.org
*
* @copyright 2019 KanREN, Inc.
* @author Heath Barnhart <hbarnhart@kanren.net>
*/
Expand All @@ -51,6 +54,7 @@ public static function genSQL($rule, $query_builder = false)

/**
* Generate SQL from Rule
*
* @param string $rule Rule to generate SQL for
* @return string|bool
*/
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/AlertData.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
*
* @copyright 2018 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
Expand Down
3 changes: 3 additions & 0 deletions LibreNMS/Alert/AlertRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Original Code:
*
* @author Daniel Preussker <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
*
* @link https://www.librenms.org
*
* @copyright 2019 KanREN, Inc.
* @author Heath Barnhart <hbarnhart@kanren.net>
*/
Expand Down
5 changes: 5 additions & 0 deletions LibreNMS/Alert/AlertUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
*
* @copyright 2019 KanREN, Inc.
* @author Heath Barnhart <hbarnhart@kanren.net>
*/
Expand Down Expand Up @@ -73,6 +74,7 @@ public static function getDefaultAlertTransports()

/**
* Find contacts for alert
*
* @param array $results Rule-Result
* @return array
*/
Expand Down Expand Up @@ -193,6 +195,7 @@ public static function getRules($device_id)

/**
* Check if device is under maintenance
*
* @param int $device_id Device-ID
* @return bool
*/
Expand All @@ -203,6 +206,7 @@ public static function isMaintenance($device_id)

/**
* Check if device is set to ignore alerts
*
* @param int $device_id Device-ID
* @return bool
*/
Expand All @@ -215,6 +219,7 @@ public static function hasDisableNotify($device_id)

/**
* Process Macros
*
* @param string $rule Rule to process
* @param int $x Recursion-Anchor
* @return string|bool
Expand Down
10 changes: 10 additions & 0 deletions LibreNMS/Alert/RunAlerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class RunAlerts
{
/**
* Populate variables
*
* @param string $txt Text with variables
* @param bool $wrap Wrap variable for text-usage (default: true)
* @return string
Expand Down Expand Up @@ -76,6 +77,7 @@ public function populate($txt, $wrap = true)

/**
* Describe Alert
*
* @param array $alert Alert-Result from DB
* @return array|bool|string
*/
Expand Down Expand Up @@ -196,6 +198,7 @@ public function describeAlert($alert)

/**
* Format Elapsed Time
*
* @param int $secs Seconds elapsed
* @return string
*/
Expand Down Expand Up @@ -236,6 +239,7 @@ public function clearStaleAlerts()

/**
* Re-Validate Rule-Mappings
*
* @param int $device_id Device-ID
* @param int $rule Rule-ID
* @return bool
Expand All @@ -258,6 +262,7 @@ public function isRuleValid($device_id, $rule)

/**
* Issue Alert-Object
*
* @param array $alert
* @return bool
*/
Expand Down Expand Up @@ -285,6 +290,7 @@ public function issueAlert($alert)

/**
* Issue ACK notification
*
* @return void
*/
public function runAcks()
Expand All @@ -297,6 +303,7 @@ public function runAcks()

/**
* Run Follow-Up alerts
*
* @return void
*/
public function runFollowUp()
Expand Down Expand Up @@ -381,6 +388,7 @@ public function loadAlerts($where)

/**
* Run all alerts
*
* @return void
*/
public function runAlerts()
Expand Down Expand Up @@ -488,6 +496,7 @@ public function runAlerts()

/**
* Run external transports
*
* @param array $obj Alert-Array
* @return void
*/
Expand Down Expand Up @@ -576,6 +585,7 @@ public function alertLog($result, $obj, $transport)
/**
* Check if a device's all parent are down
* Returns true if all parents are down
*
* @param int $device Device-ID
* @return bool
*/
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
*
* @copyright 2018 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
Expand Down
2 changes: 2 additions & 0 deletions LibreNMS/Alert/Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ abstract class Transport implements TransportInterface

/**
* Transport constructor.
*
* @param null $transport_id
*/
public function __construct($transport_id = null)
Expand Down Expand Up @@ -44,6 +45,7 @@ protected function parseUserOptions($input)

/**
* Get the hex color string for a particular state
*
* @param int $state State code from alert
* @return string Hex color, default to #337AB7 blue if state unrecognised
*/
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Alerta.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* the source code distribution for details. */
/**
* API Transport
*
* @author GitStoph <https://github.com/GitStoph>
* @copyright 2019 GitStoph
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Alertmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Alertmanager Transport
*
* @copyright 2019 LibreNMS
* @license GPL
*/
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* API Transport
*
* @author f0o <f0o@devilcode.org>
* @author PipoCanaja (github.com/PipoCanaja)
* @copyright 2014 f0o, LibreNMS
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Boxcar.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

/**
* Boxcar API Transport
*
* @author trick77 <jan@trick77.com>
* @copyright 2015 trick77, neokjames, f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Clickatell.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Clickatell REST-API Transport
*
* @author f0o <f0o@librenms.org>
* @copyright 2015 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
*
* @copyright 2018 Ryan Finney
* @author https://github.com/theherodied/
* @contributer f0o, sdef2
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Dummy Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Gitlab.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* GitLab API Transport
*
* @author Drew Hynes <drew.hynes@gmail.com>
* @copyright 2018 Drew Hynes, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Googlechat.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @link http://librenms.org
*
* @copyright 2021 Pablo Baldovi
* @author Pablo Baldovi <pbaldovi@gmail.com>
*/
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Irc.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* IRC Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Jira.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Jira API Transport
*
* @author Aldemir Akpinar <aldemir.akpinar@gmail.com>
* @copyright 2017 Aldemir Akpinar, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Mail Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Matrix Transport
*
* @author Raphael Dannecker (github.com/raphael247)
* @copyright 2020 , LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Mattermost.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Mattermost API Transport
*
* @author George Pantazis <gpant@eservices-greece.com>
* @copyright 2019 George Pantazis, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Nagios.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Nagios Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Opsgenie.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* OpsGenie API Transport
*
* @author Celal Emre CICEK <celal.emre@opsgenie.com>
* @copyright 2017 Celal Emre CICEK
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Pagerduty.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* PagerDuty Generic-API Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2015 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Playsms.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* PlaySMS API Transport
*
* @author f0o <f0o@librenms.org>
* @copyright 2015 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Pushbullet.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* Pushbullet API Transport
*
* @author f0o <f0o@librenms.org>
* @copyright 2015 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Pushover.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

/**
* Pushover API Transport
*
* @author neokjames <neokjames@gmail.com>
* @copyright 2015 neokjames, f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Rocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* API Transport
*
* @author ToeiRei <vbauer@stargazer.at>
* @copyright 2017 ToeiRei, LibreNMS work based on the work of f0o. It's his work.
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Sensu.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* API Transport
*
* @author Adam Bishop <adam@omega.org.uk>
* @copyright 2020 Adam Bishop, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Signal.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* Signal Transport
*
* @author kzink <kevin.zink@mpi-hd.mpg.de>
* @copyright 2021 kzink, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Signalwire.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* SignalWire API Transport
*
* @author Igor Kuznetsov <igor@oczmail.com>
* This is modifyed Twilio class from Andy Rosen <arosen@arosen.net>
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* API Transport
*
* @author f0o <f0o@devilcode.org>
* @copyright 2014 f0o, LibreNMS
* @license GPL
Expand Down
1 change: 1 addition & 0 deletions LibreNMS/Alert/Transport/Smseagle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* SMSEagle API Transport
*
* @author Barry O'Donovan <barry@lightnet.ie>
* @copyright 2017 Barry O'Donovan, LibreNMS
* @license GPL
Expand Down
Loading

0 comments on commit 258505e

Please sign in to comment.