Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Apr 11, 2024
1 parent 835ada3 commit 96c1d20
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 57 deletions.
5 changes: 2 additions & 3 deletions ajax/showtaskjoblogdetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@

$agents_id = filter_input(INPUT_POST, "agents_id");
$uniqid = filter_input(INPUT_POST, "uniqid");
if (
is_null($agents_id) || $agents_id === false || !is_numeric($agents_id) ||
is_null($uniqid) || $uniqid === false || !is_numeric($uniqid)
if (is_null($agents_id) || $agents_id === false || !is_numeric($agents_id) ||
is_null($uniqid) || $uniqid === false || !is_numeric($uniqid)
) {
// not allowed
exit;
Expand Down
9 changes: 4 additions & 5 deletions ajax/taskjobaddtype.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@
$items_id = filter_input(INPUT_POST, "items_id");
$taskjobs_id = filter_input(INPUT_POST, "taskjobs_id");

if (
is_null($type) ||
is_null($itemtype) ||
is_null($items_id) || !is_numeric($items_id) ||
is_null($taskjobs_id) || !is_numeric($taskjobs_id)
if (is_null($type) ||
is_null($itemtype) ||
is_null($items_id) || !is_numeric($items_id) ||
is_null($taskjobs_id) || !is_numeric($taskjobs_id)
) {
exit;
}
Expand Down
5 changes: 2 additions & 3 deletions front/deploypackage.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@
}

$packages_id = filter_input(INPUT_POST, "packages_id");
if (
is_null($packages_id) || $packages_id === false ||
!is_numeric($packages_id) || intval($packages_id) === 0
if (is_null($packages_id) || $packages_id === false ||
!is_numeric($packages_id) || intval($packages_id) === 0
) {
Html::displayErrorAndDie("Error with wrong format of data sent");
}
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleentity.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleimport.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "inventoryruleimport");

Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Html::header(__('FusionInventory', 'fusioninventory'), $_SERVER["PHP_SELF"],
"admin", "pluginfusioninventorymenu", "inventoryruleimport");

Expand Down
2 changes: 1 addition & 1 deletion front/inventoryrulelocation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryrulelocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleremotework.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
"admin",
Expand Down
2 changes: 1 addition & 1 deletion front/inventoryruleremotework.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}

Session::checkLoginUser();
Html::header(__('FusionInventory', 'fusioninventory'),
$_SERVER["PHP_SELF"],
Expand Down
2 changes: 1 addition & 1 deletion inc/communicationnetworkinventory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ function is_wireless_controller($a_inventory, $parent_index = 0) {
* @param mixed[] $a_inventory
* @return mixed[]
*/
function get_wireless_controller_access_points($a_inventory) {
function get_wireless_controller_access_points($a_inventory) {
$accesspoints = [];
$num = 0;
foreach ($a_inventory['components'] as $component) {
Expand Down
29 changes: 13 additions & 16 deletions inc/deployaction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function removeLine(item) {
* Clean data of package form
* @return array{'id': integer, 'actionstype': string, 'name': string, 'exec'?: string, 'retChecks'?: array{'type': string, 'values': (string|integer)[]}[], 'logLineLimit'?: int, 'from'?: string, 'to'?: string, 'list'?: string[]}|false
*/
function check_data_from_form() {
function check_data_from_form() {
$id = filter_input(INPUT_POST, "id");
$actionstype = filter_input(INPUT_POST, "actionstype");
$name = filter_input(INPUT_POST, "name");
Expand All @@ -490,10 +490,9 @@ function check_data_from_form() {
$from = filter_input(INPUT_POST, "from");
$to = filter_input(INPUT_POST, "to");

if (
is_null($id) || $id === false || !is_numeric($id) ||
is_null($actionstype) || $actionstype === false ||
is_null($name) || $name === false
if (is_null($id) || $id === false || !is_numeric($id) ||
is_null($actionstype) || $actionstype === false ||
is_null($name) || $name === false
) {
return false;
}
Expand All @@ -515,10 +514,9 @@ function check_data_from_form() {
$data['exec'] = $exec;
$data['logLineLimit'] = intval($logLineLimit);
$data['retChecks'] = [];
if (
isset($_POST['retchecks_type']) && is_array($_POST['retchecks_type']) &&
isset($_POST['retchecks_value']) && is_array($_POST['retchecks_value']) &&
count($_POST['retchecks_type']) == count($_POST['retchecks_value'])
if (isset($_POST['retchecks_type']) && is_array($_POST['retchecks_type']) &&
isset($_POST['retchecks_value']) && is_array($_POST['retchecks_value']) &&
count($_POST['retchecks_type']) == count($_POST['retchecks_value'])
) {
foreach ($_POST['retchecks_type'] as $index => $type) {
if ($type !== '0') {
Expand Down Expand Up @@ -548,20 +546,19 @@ function check_data_from_form() {

case 'mkdir':
case 'delete':
if (
!isset($_POST['list']) ||
!isset($_POST['list'][0]) ||
$_POST['list'][0] === false ||
!is_string($_POST['list'][0]) ||
empty($_POST['list'][0])
if (!isset($_POST['list']) ||
!isset($_POST['list'][0]) ||
$_POST['list'][0] === false ||
!is_string($_POST['list'][0]) ||
empty($_POST['list'][0])
) {
return false;
}
$data['list'] = [
$_POST['list'][0]
];
break;

}
return $data;
}
Expand Down
13 changes: 6 additions & 7 deletions inc/deploycheck.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static function formatCheckForJson($params) {
* Clean data of package form
* @return array{'id': integer,'checkstype': string, 'name': string, 'path': string, 'return': string, 'value': string, 'unit': string}|false
*/
function check_data_from_form() {
function check_data_from_form() {
$id = filter_input(INPUT_POST, "id");
$checkstype = filter_input(INPUT_POST, "checkstype");
$name = filter_input(INPUT_POST, "name");
Expand All @@ -644,12 +644,11 @@ function check_data_from_form() {
$value = filter_input(INPUT_POST, "value");
$unit = filter_input(INPUT_POST, "unit");

if (
is_null($id) || $id === false || !is_numeric($id) ||
is_null($checkstype) || $checkstype === false ||
is_null($name) || $name === false ||
is_null($path) || $path === false || !is_string($path) || empty($path) ||
is_null($return) || $return === false
if (is_null($id) || $id === false || !is_numeric($id) ||
is_null($checkstype) || $checkstype === false ||
is_null($name) || $name === false ||
is_null($path) || $path === false || !is_string($path) || empty($path) ||
is_null($return) || $return === false
) {
return false;
}
Expand Down
7 changes: 3 additions & 4 deletions inc/deployfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,8 @@ function check_data_from_form() {
$filestype = filter_input(INPUT_POST, "filestype");
$filename = filter_input(INPUT_POST, "filename");

if (
is_null($id) || $id === false || !is_numeric($id) ||
is_null($retentionDuration) || $retentionDuration === false || !is_numeric($retentionDuration)
if (is_null($id) || $id === false || !is_numeric($id) ||
is_null($retentionDuration) || $retentionDuration === false || !is_numeric($retentionDuration)
) {
return false;
}
Expand Down Expand Up @@ -545,7 +544,7 @@ function check_data_from_form() {
}
return $data;
}


/**
* Add a new item in files of the package
Expand Down
15 changes: 7 additions & 8 deletions inc/deployuserinteraction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,20 @@ function getInteractionDescription($interaction) {
* Clean data of package form
* @return array{'id': integer, 'type': string, 'name': string, 'title': string, 'text': string, 'template': integer}|false
*/
function check_data_from_form() {
function check_data_from_form() {
$id = filter_input(INPUT_POST, "id");
$type = filter_input(INPUT_POST, "userinteractionstype");
$name = filter_input(INPUT_POST, "name");
$title = filter_input(INPUT_POST, "title");
$text = filter_input(INPUT_POST, "text");
$template = filter_input(INPUT_POST, "template");

if (
is_null($id) || $id === false || !is_numeric($id) ||
is_null($type) || $type === false ||
is_null($name) || $name === false ||
is_null($title) || $title === false || empty($title) ||
is_null($text) || $text === false ||
is_null($template) || $template === false || !is_numeric($template)
if (is_null($id) || $id === false || !is_numeric($id) ||
is_null($type) || $type === false ||
is_null($name) || $name === false ||
is_null($title) || $title === false || empty($title) ||
is_null($text) || $text === false ||
is_null($template) || $template === false || !is_numeric($template)
) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions inc/taskview.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,6 @@ function csvExport($params = []) {
* Force running the current task
* @return void
**/
function forceRunning() {
}
function forceRunning() {
}
}

0 comments on commit 96c1d20

Please sign in to comment.