Apply fixes from StyleCI (#12117)

* Apply fixes from StyleCI

* Disable style check
This commit is contained in:
Jellyfrog
2020-09-21 14:54:51 +02:00
committed by GitHub
parent 8ec9183df5
commit 77c531527c
752 changed files with 6238 additions and 5833 deletions

View File

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