Skip to content

Commit b092404

Browse files
committed
php cs fixer
1 parent 3ff27f1 commit b092404

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.php-cs-fixer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
$finder = Finder::create()
77
->in(__DIR__)
8-
->name('*.php');
8+
->name('*.php')
9+
->ignoreVCSIgnored(true);
910

1011
$config = new Config();
1112

1213
$rules = [
1314
'@PER-CS2.0' => true,
15+
'@PHP84Migration' => true,
1416
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays']], // For PHP 7.4 compatibility
1517
];
1618

inc/alert.class.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public static function findAllToNotify($params = [])
262262
$utable = PluginNewsAlert_User::getTable();
263263
$ttable = PluginNewsAlert_Target::getTable();
264264
$hidstate = PluginNewsAlert_User::HIDDEN;
265-
$users_id = isset($_SESSION['glpiID']) ? $_SESSION['glpiID'] : -1;
265+
$users_id = $_SESSION['glpiID'] ?? -1;
266266
$group_u = new Group_User();
267267
$fndgroup = [];
268268
if (isset($_SESSION['glpiID']) && $fndgroup_user = $group_u->find(['users_id' => $_SESSION['glpiID']])) {
@@ -416,7 +416,7 @@ public function checkDate($datetime)
416416
{
417417
if (preg_match('/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/', $datetime)) {
418418
$datetime = explode(' ', $datetime);
419-
list($year, $month, $day) = explode('-', $datetime[0]);
419+
[$year, $month, $day] = explode('-', $datetime[0]);
420420

421421
return checkdate((int) $month, (int) $day, (int) $year);
422422
}
@@ -735,9 +735,8 @@ public static function preItemForm($params = [])
735735
) {
736736
$item = $params['item'];
737737
$itemtype = get_class($item);
738-
$entities_id = isset($params['item']->fields['entities_id'])
739-
? $params['item']->fields['entities_id']
740-
: false; // false to use current entity
738+
$entities_id = $params['item']->fields['entities_id']
739+
?? false; // false to use current entity
741740
self::displayAlerts(['show_only_helpdesk_alerts' => true,
742741
'show_hidden_alerts' => false,
743742
'entities_id' => $entities_id,

0 commit comments

Comments
 (0)