mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI * Disable style check
This commit is contained in:
@@ -15,11 +15,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
$init_modules = array('web', 'auth');
|
||||
$init_modules = ['web', 'auth'];
|
||||
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
||||
|
||||
if (!Auth::check()) {
|
||||
die('Unauthorized');
|
||||
if (! Auth::check()) {
|
||||
exit('Unauthorized');
|
||||
}
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
@@ -32,7 +32,7 @@ set_debug($_REQUEST['debug']);
|
||||
*/
|
||||
function levsortos($base, $obj, $keys)
|
||||
{
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
foreach ($obj as $elem) {
|
||||
$lev = false;
|
||||
foreach ($keys as $key) {
|
||||
@@ -49,6 +49,7 @@ function levsortos($base, $obj, $keys)
|
||||
}
|
||||
|
||||
ksort($ret);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -59,11 +60,11 @@ if (isset($_GET['term'])) {
|
||||
$sortos = levsortos($_GET['term'], \LibreNMS\Config::get('os'), ["text", "os"]);
|
||||
$sortos = array_slice($sortos, 0, 20);
|
||||
foreach ($sortos as $lev => $os) {
|
||||
$ret[$lev] = array_intersect_key($os, array('os' => true, 'text' => true));
|
||||
$ret[$lev] = array_intersect_key($os, ['os' => true, 'text' => true]);
|
||||
}
|
||||
}
|
||||
if (!isset($ret)) {
|
||||
$ret = array(array('Error: No suggestions found.'));
|
||||
if (! isset($ret)) {
|
||||
$ret = [['Error: No suggestions found.']];
|
||||
}
|
||||
|
||||
die(json_encode($ret));
|
||||
exit(json_encode($ret));
|
||||
|
Reference in New Issue
Block a user