mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix some lint issues (#14962)
This commit is contained in:
@@ -194,7 +194,7 @@ class TwoFactor
|
||||
((ord($hash[$offset + 2]) & 0xFF) << 8) |
|
||||
(ord($hash[$offset + 3]) & 0xFF)) % pow(10, self::OTP_SIZE);
|
||||
|
||||
return str_pad($truncated, self::OTP_SIZE, '0', STR_PAD_LEFT);
|
||||
return str_pad("$truncated", self::OTP_SIZE, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -236,7 +236,7 @@ class Processor extends Model implements DiscoveryModule, PollerModule, Discover
|
||||
private static function processData($data, $precision)
|
||||
{
|
||||
preg_match('/([0-9]{1,5}(\.[0-9]+)?)/', $data, $matches);
|
||||
$value = $matches[1];
|
||||
$value = (float) $matches[1];
|
||||
|
||||
if ($precision < 0) {
|
||||
// idle value, subtract from 100
|
||||
|
@@ -238,7 +238,7 @@ class YamlDiscovery
|
||||
return current($pre_cache[$name]);
|
||||
} elseif (isset($sub_indexes[$sub_index])) {
|
||||
if ($sub_index_end) {
|
||||
$multi_sub_index = implode('.', array_slice($sub_indexes, $sub_index, $sub_index_end));
|
||||
$multi_sub_index = implode('.', array_slice($sub_indexes, (int) $sub_index, (int) $sub_index_end));
|
||||
if (isset($pre_cache[$name][$multi_sub_index][$name])) {
|
||||
return $pre_cache[$name][$multi_sub_index][$name];
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class MaximumExecutionTimeExceeded extends \Exception implements UpgradeableExce
|
||||
public function render(\Illuminate\Http\Request $request)
|
||||
{
|
||||
$title = preg_match('/ (\d+) /', $this->message, $matches)
|
||||
? trans_choice('exceptions.maximum_execution_time_exceeded.title', $matches[1], ['seconds' => $matches[1]])
|
||||
? trans_choice('exceptions.maximum_execution_time_exceeded.title', (int) $matches[1], ['seconds' => (int) $matches[1]])
|
||||
: $this->getMessage();
|
||||
|
||||
$message = trans('exceptions.maximum_execution_time_exceeded.message');
|
||||
|
Reference in New Issue
Block a user