Commit 4b36b2b0 authored by Anael Mobilia's avatar Anael Mobilia Committed by Johan Cwiklinski
Browse files

Apply PHPCS rule

  <!-- White space after IF keyword -->
  <rule ref="Squiz.ControlStructures.ControlSignature" />

+ Fix current code for this rule

Part of #1209
parent c3dc8e78
......@@ -91,7 +91,7 @@ foreach ($notvalidoptions as $key) {
unset($options[$key]);
}
}
if(isset($options['locked'])) {
if (isset($options['locked'])) {
ObjectLock::setReadOnlyProfile() ;
}
CommonGLPI::displayStandardTab($item, $_GET['_glpi_tab'], $_GET["withtemplate"], $options);
......
......@@ -121,7 +121,7 @@ if (isset($_POST["type"])
case "group" :
$cond = '`is_requester`';
if ($_POST["actortype"] == 'assign') {
if ($_POST["actortype"] == 'assign') {
$cond = '`is_assign`';
}
......
......@@ -43,7 +43,7 @@ header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (isset($_POST["validatortype"])) {
switch ($_POST["validatortype"]){
switch ($_POST["validatortype"]) {
case 'user' :
echo "<input type='hidden' name='groups_id' value=0 />";
User::dropdown(array('name' => 'users_id_validate',
......@@ -82,7 +82,7 @@ if (isset($_POST["validatortype"])) {
$users = array();
$param['values'] = array();
foreach ($groups_users as $data){
foreach ($groups_users as $data) {
$users[$data['id']] = formatUserName($data['id'], $data['name'], $data['realname'],
$data['firstname']);
}
......@@ -99,7 +99,7 @@ if (isset($_POST["validatortype"])) {
Dropdown::showFromArray("users_id_validate", $users, $param);
// Display all/none buttons to select all or no users in group
if (!empty($_POST['groups_id'])){
if (!empty($_POST['groups_id'])) {
echo "<a id='all_users' class='vsubmit'>".__('All')."</a>";
$param_button['validatortype'] = 'group_user';
$param_button['users_id_validate'] = '';
......
......@@ -50,7 +50,7 @@ if ($_POST["authtype"] > 0) {
$name = $_POST['name'];
}
switch($_POST["authtype"]) {
switch ($_POST["authtype"]) {
case Auth::DB_GLPI :
echo "<input type='hidden' name='auths_id' value='0'>";
break;
......
......@@ -43,7 +43,7 @@ header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (isset($_POST["validatortype"])) {
switch ($_POST["validatortype"]){
switch ($_POST["validatortype"]) {
case 'user' :
if (isset($_POST['users_id_validate']['groups_id'])) {
$_POST['users_id_validate'] = array();
......@@ -98,7 +98,7 @@ if (isset($_POST["validatortype"])) {
if (isset($_POST['users_id_validate']) && is_array($_POST['users_id_validate'])) {
$values = $_POST['users_id_validate'];
}
foreach($data_users as $data){
foreach ($data_users as $data) {
$users[$data['id']] = formatUserName($data['id'], $data['name'], $data['realname'],
$data['firstname']);
if (in_array($data['id'], $values)) {
......@@ -120,7 +120,7 @@ if (isset($_POST["validatortype"])) {
$users, $param);
// Display all/none buttons to select all or no users in group
if (!empty($_POST['groups_id'])){
if (!empty($_POST['groups_id'])) {
echo "<br><br><a id='all_users' class='vsubmit'>".__('All')."</a>";
$param_button['validatortype'] = 'list_users';
$param_button['name'] = !empty($_POST['name']) ? $_POST['name']:'';
......
......@@ -52,7 +52,7 @@ if (isset($_POST['search_string'])) {
WHERE `name` LIKE '%".$_POST['search_string']."%'
ORDER BY `completename`";
foreach($DB->request($query) as $data) {
foreach ($DB->request($query) as $data) {
$ancestors = getAncestorsOf('glpi_entities', $data['id']);
foreach ($ancestors as $val) {
$res[] = '#ent'.$val;
......
......@@ -69,7 +69,7 @@ if ($item->isEntityAssign()) {
$where = "WHERE 1";
}
if(isset($_POST['used']) && !empty($_POST['used'])){
if (isset($_POST['used']) && !empty($_POST['used'])) {
$where .= " AND `id` NOT IN ('".implode("','", $_POST['used'])."') ";
}
......
......@@ -366,7 +366,7 @@ if ($item instanceof CommonTreeDropdown) {
&& (!isset($last_level_displayed[$work_level])
|| ($last_level_displayed[$work_level] != $work_parentID)));
// Add parents
foreach($parent_datas as $val){
foreach ($parent_datas as $val) {
array_push($datastoadd, $val);
}
}
......
......@@ -46,7 +46,7 @@ Html::header_nocache();
Session::checkLoginUser();
if (isset($_POST['data'])) {
foreach($_POST['data'] as $key => $values){
foreach ($_POST['data'] as $key => $values) {
$unique_name = Rule::getUuid();
$response[$key] = array('tag' => Document::getImageTag($unique_name), 'name' => $unique_name);
}
......
......@@ -39,7 +39,7 @@ if (!isset($_POST['action'])) {
exit;
}
switch($_POST['action']) {
switch ($_POST['action']) {
case "change_task_state":
if (!isset($_POST['tasks_id'])) {
exit();
......@@ -71,7 +71,7 @@ switch($_POST['action']) {
&& $parent->getFromDB($_POST[$parent->getForeignKeyField()])) {
$ol = ObjectLock::isLocked( $_POST['parenttype'], $parent->getID() ) ;
if($ol && (Session::getLoginUserID() != $ol->fields['users_id'])) {
if ($ol && (Session::getLoginUserID() != $ol->fields['users_id'])) {
ObjectLock::setReadOnlyProfile( ) ;
}
......
......@@ -71,7 +71,7 @@ if (isset($_GET['unlock']) && isset($_GET["id"])) {
} else if (isset($_GET['lockstatus'])
&& isset($_GET["id"])) {
$ol = new ObjectLock() ;
if($ol->getFromDB($_GET["id"])) {
if ($ol->getFromDB($_GET["id"])) {
$ret = 1 ; // found = still locked
} // else will return 0 = not found
}
......
......@@ -169,7 +169,7 @@ function get_content($DB, $table, $from, $limit) {
while ($row = $DB->fetch_row($result)) {
$insert = "INSERT INTO `$table` VALUES (";
for($j=0 ; $j<$num_fields ; $j++) {
for ($j=0 ; $j<$num_fields ; $j++) {
if (is_null($row[$j])) {
$insert .= "NULL,";
} else if ($row[$j] != "") {
......
......@@ -75,7 +75,7 @@ if (isset($_POST['execute'])) {
}
Html::back();
}else {
} else {
if (!isset($_GET["id"]) || empty($_GET["id"])) {
exit();
}
......
......@@ -49,7 +49,7 @@ if (isset($_POST["add"])) {
$_POST['items_id'] = $_POST['add_items_id'];
}
if(!isset($_POST['items_id']) || empty($_POST['items_id'])){
if (!isset($_POST['items_id']) || empty($_POST['items_id'])) {
$message = sprintf(__('Mandatory fields are not filled. Please correct: %s'),
_n('Associated element', 'Associated elements', 1));
Session::addMessageAfterRedirect($message, false, ERROR);
......
......@@ -76,7 +76,7 @@ if (isset($_POST["add"])) {
sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else if (isset($_POST["addvisibility"])) {
} else if (isset($_POST["addvisibility"])) {
if (isset($_POST["_type"]) && !empty($_POST["_type"])
&& isset($_POST["reminders_id"]) && $_POST["reminders_id"]) {
$item = NULL;
......@@ -112,7 +112,7 @@ if (isset($_POST["add"])) {
}
Html::back();
} else {
} else {
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
Html::helpHeader(Reminder::getTypeName(Session::getPluralNumber()), '', $_SESSION["glpiname"]);
} else {
......
......@@ -198,7 +198,7 @@ if (isset($query) && count($query)) {
if (!isset($data['itemdeleted'])) {
$data['itemdeleted'] = 0;
}
if (!isset($data['buy_date'])){
if (!isset($data['buy_date'])) {
$data['buy_date'] = '';
}
if (!isset($data['warranty_duration'])) {
......
......@@ -64,6 +64,6 @@ if (isset($_POST["locations_id"]) && $_POST["locations_id"]) {
Html::footer();
} else {
} else {
Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php");
}
......@@ -65,6 +65,6 @@ if (isset($_POST["prise"]) && $_POST["prise"]) {
Html::footer();
} else {
} else {
Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php");
}
......@@ -58,6 +58,6 @@ if (isset($_POST["switch"]) && $_POST["switch"]) {
Html::footer();
} else {
} else {
Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php");
}
......@@ -70,7 +70,7 @@ if (isset($_POST["add"])) {
sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else if (isset($_POST["addvisibility"])) {
} else if (isset($_POST["addvisibility"])) {
if (isset($_POST["_type"]) && !empty($_POST["_type"])
&& isset($_POST["rssfeeds_id"]) && $_POST["rssfeeds_id"]) {
$item = NULL;
......@@ -106,7 +106,7 @@ if (isset($_POST["add"])) {
}
Html::back();
} else {
} else {
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
Html::helpHeader(RSSFeed::getTypeName(Session::getPluralNumber()), '', $_SESSION["glpiname"]);
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment