diff --git a/ajax/sendMDMCommand.php b/ajax/sendMDMCommand.php
index 81b9d82..9bd1f59 100644
--- a/ajax/sendMDMCommand.php
+++ b/ajax/sendMDMCommand.php
@@ -67,7 +67,6 @@
$items = [];
foreach ($_POST['items_id'] as $items_id) {
- /** @var PluginJamfMobileDevice $item */
$item = new PluginJamfMobileDevice();
$item->getFromDB((int) $items_id);
$items[] = $item;
diff --git a/inc/migration.class.php b/inc/migration.class.php
index bc96413..c3228c0 100644
--- a/inc/migration.class.php
+++ b/inc/migration.class.php
@@ -89,7 +89,7 @@ public function applyMigrations()
}
// Sort semantically
- uksort($versionMap, 'version_compare');
+ uksort($versionMap, version_compare(...));
// Get last known recorded version. If none exists, assume this is 1.0.0 since versions weren't recorded until 2.0.0.
// Migrations should be replayable so nothing should be lost on multiple runs.
diff --git a/inc/ruleimport.class.php b/inc/ruleimport.class.php
index 416e33f..83d4794 100644
--- a/inc/ruleimport.class.php
+++ b/inc/ruleimport.class.php
@@ -52,40 +52,38 @@ public function maxActionsCount()
public function getCriterias()
{
- $criterias = [];
- $criterias['name']['field'] = 'name';
- $criterias['name']['name'] = _x('field', 'Name', 'jamf');
- $criterias['name']['table'] = '';
-
- $criterias['itemtype']['field'] = 'itemtype';
- $criterias['itemtype']['name'] = _x('field', 'Item type', 'jamf');
- $criterias['itemtype']['table'] = '';
- $criterias['itemtype']['allow_condition'] = [Rule::PATTERN_IS, Rule::PATTERN_IS_NOT];
-
- $criterias['last_inventory']['field'] = 'last_inventory';
- $criterias['last_inventory']['name'] = _x('field', 'Last inventory', 'jamf');
- $criterias['last_inventory']['table'] = '';
-
- $criterias['managed']['field'] = 'managed';
- $criterias['managed']['name'] = _x('field', 'Managed', 'jamf');
- $criterias['managed']['type'] = 'yesno';
- $criterias['managed']['table'] = '';
-
- $criterias['supervised']['field'] = 'supervised';
- $criterias['supervised']['name'] = _x('field', 'Supervised', 'jamf');
- $criterias['supervised']['type'] = 'yesno';
- $criterias['supervised']['table'] = '';
-
- return $criterias;
+ return ['name' => [
+ 'field' => 'name',
+ 'name' => _x('field', 'Name', 'jamf'),
+ 'table' => '',
+ ], 'itemtype' => [
+ 'field' => 'itemtype',
+ 'name' => _x('field', 'Item type', 'jamf'),
+ 'table' => '',
+ 'allow_condition' => [Rule::PATTERN_IS, Rule::PATTERN_IS_NOT],
+ ], 'last_inventory' => [
+ 'field' => 'last_inventory',
+ 'name' => _x('field', 'Last inventory', 'jamf'),
+ 'table' => '',
+ ], 'managed' => [
+ 'field' => 'managed',
+ 'name' => _x('field', 'Managed', 'jamf'),
+ 'type' => 'yesno',
+ 'table' => '',
+ ], 'supervised' => [
+ 'field' => 'supervised',
+ 'name' => _x('field', 'Supervised', 'jamf'),
+ 'type' => 'yesno',
+ 'table' => '',
+ ]];
}
public function getActions()
{
- $actions = [];
- $actions['_import']['name'] = _x('action', 'Import', 'jamf');
- $actions['_import']['type'] = 'yesno';
-
- return $actions;
+ return ['_import' => [
+ 'name' => _x('action', 'Import', 'jamf'),
+ 'type' => 'yesno',
+ ]];
}
public function displayAdditionalRuleCondition($condition, $crit, $name, $value, $test = false)
diff --git a/inc/sync.class.php b/inc/sync.class.php
index 23f5352..0de5237 100644
--- a/inc/sync.class.php
+++ b/inc/sync.class.php
@@ -223,7 +223,6 @@ protected function applyDesiredState($itemtype, $match_criteria, $state, $option
throw new Exception('Item type class ' . $itemtype . ' must extend CommonDBTM');
}
- /** @var CommonDBTM $item */
$item = new $itemtype();
$item_matches = $item->find($match_criteria);
if (!count($item_matches)) {
diff --git a/jamf.xml b/jamf.xml
index a6201f8..8ae04d6 100644
--- a/jamf.xml
+++ b/jamf.xml
@@ -3,7 +3,7 @@
JAMF Plugin for GLPI
jamf
stable
- https://raw.githubusercontent.com/pluginsGLPI/jamf/master/Logo.png
+ https://raw.githubusercontent.com/pluginsGLPI/jamf/main/Logo.png
Sync devices and data from Jamf to GLPI