mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove Laravel helpers (#11428)
* Remove Laravel helpers * Replace qualifier with import
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
namespace LibreNMS\Util;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Exceptions\FileNotFoundException;
|
||||
use LibreNMS\Exceptions\InvalidModuleException;
|
||||
@@ -285,7 +286,7 @@ class ModuleTestHelper
|
||||
{
|
||||
$full_name = basename($os_file, '.json');
|
||||
|
||||
if (!str_contains($full_name, '_')) {
|
||||
if (!Str::contains($full_name, '_')) {
|
||||
return [$full_name, ''];
|
||||
} elseif (is_file(Config::get('install_dir') . "/includes/definitions/$full_name.yaml")) {
|
||||
return [$full_name, ''];
|
||||
@@ -362,7 +363,7 @@ class ModuleTestHelper
|
||||
$result[] = "$oid|4|"; // empty data, we don't know type, put string
|
||||
} else {
|
||||
list($raw_type, $data) = explode(':', $raw_data, 2);
|
||||
if (starts_with($raw_type, 'Wrong Type (should be ')) {
|
||||
if (Str::startsWith($raw_type, 'Wrong Type (should be ')) {
|
||||
// device returned the wrong type, save the wrong type to emulate the device behavior
|
||||
list($raw_type, $data) = explode(':', ltrim($data), 2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user