Skip to content

Commit b63671f

Browse files
authored
Fix(CI): rector (#430)
* Fix(CI): rector * fix
1 parent d19dbb0 commit b63671f

3 files changed

Lines changed: 8 additions & 17 deletions

File tree

inc/group_group.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function getGroups($ticket_id, $removeAlreadyAssigned = true)
161161
// To do an escalation, the user must be in a group currently assigned to the ticket
162162
// or no group is assigned to the ticket
163163
// TODO : matching with "view all tickets (yes/no) option in profile user"
164-
if ($ticket_groups !== [] && count(array_intersect($ticket_groups, $user_groups)) == 0) {
164+
if ($ticket_groups !== [] && array_intersect($ticket_groups, $user_groups) === []) {
165165
return [];
166166
}
167167

@@ -196,7 +196,7 @@ public function getGroups($ticket_id, $removeAlreadyAssigned = true)
196196
$groupname = $group_obj->fields['name'];
197197
}
198198

199-
if (count($groups) == 0) {
199+
if ($groups === []) {
200200
Group_User::getUserGroups($_SESSION['glpiID']);
201201
}
202202

inc/history.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PluginEscaladeHistory extends CommonDBTM
3939
public static function getFirstLineForTicket($tickets_id)
4040
{
4141
$found = self::getFullHistory($tickets_id);
42-
if (count($found) == 0) {
42+
if (count($found) === 0) {
4343
return false;
4444
} else {
4545
return array_pop($found);
@@ -49,7 +49,7 @@ public static function getFirstLineForTicket($tickets_id)
4949
public static function getlastLineForTicket($tickets_id)
5050
{
5151
$found = self::getFullHistory($tickets_id);
52-
if (count($found) == 0) {
52+
if (count($found) === 0) {
5353
return false;
5454
} else {
5555
return array_shift($found);
@@ -222,7 +222,7 @@ public static function getHistory($tickets_id, $full_history = false)
222222
echo "</div>";
223223

224224
$i++;
225-
if ($i == self::HISTORY_LIMIT && !$full_history) {
225+
if ($i === self::HISTORY_LIMIT && !$full_history) {
226226
break;
227227
}
228228
}

inc/ticket.class.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,30 +1035,21 @@ public static function cloneAndLink($tickets_id)
10351035
SELECT null AS id, {$newID} as tickets_id, users_id, type, use_notification, alternative_email
10361036
FROM glpi_tickets_users
10371037
WHERE tickets_id = {$tickets_id} AND type != 2";
1038-
if (!$res = $DB->doQuery($query_users)) {
1039-
Session::addMessageAfterRedirect(__s('Error : adding actors (user)', 'escalade'), false, ERROR);
1040-
return;
1041-
}
1038+
$DB->doQuery($query_users);
10421039

10431040
//groups
10441041
$query_groups = "INSERT INTO glpi_groups_tickets
10451042
SELECT null AS id, {$newID} as tickets_id, groups_id, type
10461043
FROM glpi_groups_tickets
10471044
WHERE tickets_id = {$tickets_id} AND type != 2";
1048-
if (!$res = $DB->doQuery($query_groups)) {
1049-
Session::addMessageAfterRedirect(__s('Error : adding actors (group)', "escalade"), false, ERROR);
1050-
return;
1051-
}
1045+
$DB->doQuery($query_groups);
10521046

10531047
//add documents
10541048
$query_docs = "INSERT INTO glpi_documents_items (documents_id, items_id, itemtype, entities_id, is_recursive, date_mod)
10551049
SELECT documents_id, {$newID}, 'Ticket', entities_id, is_recursive, date_mod
10561050
FROM glpi_documents_items
10571051
WHERE items_id = {$tickets_id} AND itemtype = 'Ticket'";
1058-
if (!$res = $DB->doQuery($query_docs)) {
1059-
Session::addMessageAfterRedirect(__s('Error : adding documents', 'escalade'), false, ERROR);
1060-
return;
1061-
}
1052+
$DB->doQuery($query_docs);
10621053

10631054
//add history to the new ticket
10641055
$changes[0] = '0';

0 commit comments

Comments
 (0)