Remove Laravel helpers (#11428)

* Remove Laravel helpers

* Replace qualifier with import
This commit is contained in:
Tony Murray
2020-04-17 17:37:56 -05:00
committed by GitHub
parent 729eeccaa4
commit 1c08c11a77
95 changed files with 426 additions and 359 deletions

View File

@@ -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);
}