From 31132865d4075775d5dab8307ff204c45c3d088a Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:16:46 +0200 Subject: [PATCH] feature/glpi-12.0 --- .github/workflows/continuous-integration.yml | 2 +- CHANGELOG.md | 6 + composer.json | 3 - composer.lock | 876 +----------------- hook.php | 4 +- inc/clientinjection.class.php | 2 +- inc/commoninjectionlib.class.php | 2 +- inc/devicecaseinjection.class.php | 4 +- inc/devicecontrolinjection.class.php | 4 +- inc/devicedriveinjection.class.php | 4 +- inc/deviceharddriveinjection.class.php | 4 +- inc/devicememoryinjection.class.php | 2 +- inc/devicemotherboardinjection.class.php | 4 +- inc/devicenetworkcardinjection.class.php | 4 +- inc/deviceprocessorinjection.class.php | 2 +- inc/entityinjection.class.php | 4 +- inc/info.class.php | 17 +- inc/knowbaseitemcategoryinjection.class.php | 91 -- inc/mapping.class.php | 2 +- inc/menu.class.php | 2 +- inc/model.class.php | 4 +- inc/modelcsv.class.php | 8 +- inc/profile.class.php | 6 +- inc/softwarelicenseinjection.class.php | 29 +- inc/softwareversioninjection.class.php | 29 +- inc/userinjection.class.php | 2 +- setup.php | 5 +- templates/clientinjection.html.twig | 1 - templates/clientinjection_result.html.twig | 1 - .../clientinjection_upload_file.html.twig | 1 - templates/mappings_form.html.twig | 1 - templates/model_validation_form.html.twig | 1 - tests/unit/CommonInjectionLibDateTimeTest.php | 5 +- tests/unit/GroupInjectionTest.php | 13 +- 34 files changed, 89 insertions(+), 1056 deletions(-) delete mode 100644 inc/knowbaseitemcategoryinjection.class.php diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a279c098..0728b59e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,7 @@ jobs: name: "Generate CI matrix" uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1" with: - glpi-version: "11.0.x" + glpi-version: "12.0.x" ci: name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" needs: "generate-ci-matrix" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f9c8cd9..a42fa5cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [UNRELEASED] + +### Added + +- GLPI 12 compatibility + ## [2.15.10] - 2026-08-07 ### Fixed diff --git a/composer.json b/composer.json index 8b1e015d..5881de25 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,6 @@ "require": { "php": ">=8.2" }, - "require-dev": { - "glpi-project/tools": "^0.8" - }, "config": { "optimize-autoloader": true, "platform": { diff --git a/composer.lock b/composer.lock index 1adb59c7..e798ec87 100644 --- a/composer.lock +++ b/composer.lock @@ -4,881 +4,9 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0bb7734a8837cdd118f20d259d3613e7", + "content-hash": "4cacb822b12bf0d2a0dbcf952b20ef7b", "packages": [], - "packages-dev": [ - { - "name": "glpi-project/tools", - "version": "0.8.3", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", - "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", - "shasum": "" - }, - "require": { - "symfony/console": "^5.4 || ^6.0", - "twig/twig": "^3.3" - }, - "require-dev": { - "nikic/php-parser": "^4.13", - "phpstan/phpstan-src": "^1.10" - }, - "bin": [ - "bin/extract-locales", - "bin/licence-headers-check", - "tools/plugin-release" - ], - "type": "library", - "autoload": { - "psr-4": { - "GlpiProject\\Tools\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "http://teclib-group.com" - } - ], - "description": "Various tools for GLPI and its plugins", - "keywords": [ - "glpi", - "plugins", - "tools" - ], - "support": { - "issues": "https://github.com/glpi-project/tools/issues", - "source": "https://github.com/glpi-project/tools" - }, - "time": "2025-10-14T10:26:06+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "symfony/console", - "version": "v6.4.43", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "3b643aa587acbc42f967a429af088a56ed8f046d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b643aa587acbc42f967a429af088a56ed8f046d", - "reference": "3b643aa587acbc42f967a429af088a56ed8f046d", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.4.43" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-07-26T14:44:19+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.7.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", - "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.7-dev" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-06-05T06:23:12+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.37.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "141046a8f9477948ff284fa65be2095baafb94f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", - "reference": "141046a8f9477948ff284fa65be2095baafb94f2", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-04-10T16:19:22+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.41.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-07-28T08:25:59+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.38.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-05-25T13:48:31+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.38.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-05-27T06:59:30+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.7.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-06-16T09:55:08+00:00" - }, - { - "name": "symfony/string", - "version": "v7.4.15", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", - "reference": "e394af32256bf9e7bf80849d95e589167c10097b", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.33", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/emoji": "^7.1|^8.0", - "symfony/http-client": "^6.4|^7.0|^8.0", - "symfony/intl": "^6.4|^7.0|^8.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0|^8.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v7.4.15" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-07-28T07:33:02+00:00" - }, - { - "name": "twig/twig", - "version": "v3.28.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "597c12ed286fb9d1701a36684ce6e0cbe28ebc8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/597c12ed286fb9d1701a36684ce6e0cbe28ebc8b", - "reference": "597c12ed286fb9d1701a36684ce6e0cbe28ebc8b", - "shasum": "" - }, - "require": { - "php": ">=8.1.0", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "php-cs-fixer/shim": "^3.0@stable", - "phpstan/phpstan": "^2.0@stable", - "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/Resources/core.php", - "src/Resources/debug.php", - "src/Resources/escaper.php", - "src/Resources/string_loader.php" - ], - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.28.0" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ], - "time": "2026-07-03T20:44:34+00:00" - } - ], + "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": {}, diff --git a/hook.php b/hook.php index 9232cc49..c5d230c8 100644 --- a/hook.php +++ b/hook.php @@ -236,7 +236,7 @@ function plugin_datainjection_migration_2158_2159(Migration $migration) // Fix remaining legacy data (old schema stored private models with `entities_id = -1`). // Must run *before* the changeField() below: the column is converted to // `unsigned`, which would mangle the `-1` values before this cleanup could match them. - if (countElementsInTable("glpi_plugin_datainjection_models", ['entities_id' => -1])) { + if (countElementsInTable("glpi_plugin_datainjection_models", ['entities_id' => -1]) !== 0) { $migration->addPreQuery( "UPDATE `glpi_plugin_datainjection_models` SET `is_private` = '1', `entities_id` = '0', `is_recursive` = '1' @@ -1913,7 +1913,7 @@ function plugin_datainjection_update220_230() /** @var DBmysql $DB */ global $DB; - if (countElementsInTable("glpi_plugin_datainjection_models", ['entities_id' => -1])) { + if (countElementsInTable("glpi_plugin_datainjection_models", ['entities_id' => -1]) !== 0) { $query = "UPDATE `glpi_plugin_datainjection_models` SET `is_private` = '1', `entities_id` = '0', diff --git a/inc/clientinjection.class.php b/inc/clientinjection.class.php index ca94ea53..59530d25 100644 --- a/inc/clientinjection.class.php +++ b/inc/clientinjection.class.php @@ -44,7 +44,7 @@ class PluginDatainjectionClientInjection { - public static $rightname = "plugin_datainjection_use"; + public static string $rightname = "plugin_datainjection_use"; public const STEP_UPLOAD = 0; public const STEP_PROCESS = 1; diff --git a/inc/commoninjectionlib.class.php b/inc/commoninjectionlib.class.php index 501fae9e..ab7e71e3 100644 --- a/inc/commoninjectionlib.class.php +++ b/inc/commoninjectionlib.class.php @@ -638,7 +638,7 @@ private function getFieldValue( $input['entities_id'] = $entity->fields['id']; } $sons = getSonsOf('glpi_entities', $input['entities_id']); - if ($result === false && !empty($sons)) { + if ($result === false && $sons !== []) { foreach ($sons as $son_id) { $result = $entity->getFromDBByCrit( [ diff --git a/inc/devicecaseinjection.class.php b/inc/devicecaseinjection.class.php index 6349c34f..27f4ef79 100644 --- a/inc/devicecaseinjection.class.php +++ b/inc/devicecaseinjection.class.php @@ -97,14 +97,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/devicecontrolinjection.class.php b/inc/devicecontrolinjection.class.php index 93390851..f8890d7b 100644 --- a/inc/devicecontrolinjection.class.php +++ b/inc/devicecontrolinjection.class.php @@ -98,14 +98,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/devicedriveinjection.class.php b/inc/devicedriveinjection.class.php index 5829840b..f6ed64d5 100644 --- a/inc/devicedriveinjection.class.php +++ b/inc/devicedriveinjection.class.php @@ -98,14 +98,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/deviceharddriveinjection.class.php b/inc/deviceharddriveinjection.class.php index 32defcef..b57eb3d2 100644 --- a/inc/deviceharddriveinjection.class.php +++ b/inc/deviceharddriveinjection.class.php @@ -99,14 +99,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/devicememoryinjection.class.php b/inc/devicememoryinjection.class.php index 6d3c8415..2b7f8d37 100644 --- a/inc/devicememoryinjection.class.php +++ b/inc/devicememoryinjection.class.php @@ -104,7 +104,7 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) 'items_id' => $values['Computer']['id'], ]; - if (!countElementsInTable($item->getTable(), $where)) { + if (countElementsInTable($item->getTable(), $where) === 0) { if ( isset($values[get_parent_class($this)]['size_default']) && ($values[get_parent_class($this)]['size_default'] > 0) diff --git a/inc/devicemotherboardinjection.class.php b/inc/devicemotherboardinjection.class.php index f48a1ce6..38226272 100644 --- a/inc/devicemotherboardinjection.class.php +++ b/inc/devicemotherboardinjection.class.php @@ -99,14 +99,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/devicenetworkcardinjection.class.php b/inc/devicenetworkcardinjection.class.php index c64dd880..0e8f3554 100644 --- a/inc/devicenetworkcardinjection.class.php +++ b/inc/devicenetworkcardinjection.class.php @@ -97,14 +97,14 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $foreign = getForeignKeyFieldForTable(getTableForItemType(get_parent_class($this))); if ( - !countElementsInTable( + countElementsInTable( $item->getTable(), [ $foreign => $values[get_parent_class($this)]['id'], 'itemtype' => 'Computer', 'items_id' => $values['Computer']['id'], ], - ) + ) === 0 ) { $tmp[$foreign] = $values[get_parent_class($this)]['id']; $tmp['items_id'] = $values['Computer']['id']; diff --git a/inc/deviceprocessorinjection.class.php b/inc/deviceprocessorinjection.class.php index c237697d..dc285bae 100644 --- a/inc/deviceprocessorinjection.class.php +++ b/inc/deviceprocessorinjection.class.php @@ -104,7 +104,7 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) 'items_id' => $values['Computer']['id'], ]; - if (!countElementsInTable($item->getTable(), $where)) { + if (countElementsInTable($item->getTable(), $where) === 0) { //try first frequency, then default_frequency if ( isset($values[get_parent_class($this)]['frequency']) diff --git a/inc/entityinjection.class.php b/inc/entityinjection.class.php index 20e45981..c19fd9ae 100644 --- a/inc/entityinjection.class.php +++ b/inc/entityinjection.class.php @@ -187,7 +187,7 @@ public function importEntity($input) ); // Entity doesn't exists => create it - if (empty($results)) { + if ($results === []) { $parent = $em->import($tmp); } else { // Entity already exists, use the ID as parent @@ -229,7 +229,7 @@ public function customDataAlreadyInDB($injectionClass, $values, $options) ['completename' => $values['completename']], ); - if (empty($results)) { + if ($results === []) { return false; } diff --git a/inc/info.class.php b/inc/info.class.php index 2eaff495..4bf503a2 100644 --- a/inc/info.class.php +++ b/inc/info.class.php @@ -35,7 +35,7 @@ class PluginDatainjectionInfo extends CommonDBTM { - public static $rightname = "plugin_datainjection_model"; + public static string $rightname = "plugin_datainjection_model"; public function getEmpty() { @@ -466,13 +466,16 @@ public static function dropdownTemplates($name, $table) $values = [0 => Dropdown::EMPTY_VALUE]; - $sql = "SELECT `id`, `template_name` - FROM `" . $table . "` - WHERE `is_template`=1 " . - getEntitiesRestrictRequest(' AND ', $table) . - "ORDER BY `template_name`"; + $result = $DB->request([ + 'SELECT' => ['id', 'template_name'], + 'FROM' => $table, + 'WHERE' => [ + 'is_template' => 1, + ] + getEntitiesRestrictCriteria($table), + 'ORDER' => 'template_name', + ]); - foreach ($DB->doQuery($sql) as $data) { + foreach ($result as $data) { $values[$data['id']] = $data['template_name']; } Dropdown::showFromArray($name, $values); diff --git a/inc/knowbaseitemcategoryinjection.class.php b/inc/knowbaseitemcategoryinjection.class.php deleted file mode 100644 index bee2b550..00000000 --- a/inc/knowbaseitemcategoryinjection.class.php +++ /dev/null @@ -1,91 +0,0 @@ -. - * ------------------------------------------------------------------------- - * @copyright Copyright (C) 2007-2023 by DataInjection plugin team. - * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html - * @link https://github.com/pluginsGLPI/datainjection - * ------------------------------------------------------------------------- - */ - - - -class PluginDatainjectionKnowbaseItemCategoryInjection extends KnowbaseItemCategory implements PluginDatainjectionInjectionInterface -{ - public static function getTable($classname = null) - { - - $parenttype = get_parent_class(self::class); - return $parenttype::getTable(); - } - - - public function isPrimaryType() - { - - return true; - } - - - public function connectedTo() - { - - return []; - } - - public function isNullable($field) - { - return true; // By default, all fields can be null - } - - - /** - * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::getOptions() - **/ - public function getOptions($primary_type = '') - { - - $tab = Search::getOptions(get_parent_class($this)); - - //Remove some options because some fields cannot be imported - $blacklist = PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(get_parent_class($this)); - $notimportable = [14]; - - $options['ignore_fields'] = array_merge($blacklist, $notimportable); - $options['displaytype'] = ["multiline_text" => [16]]; - - return PluginDatainjectionCommonInjectionLib::addToSearchOptions($tab, $options, $this); - } - - - /** - * @see plugins/datainjection/inc/PluginDatainjectionInjectionInterface::addOrUpdateObject() - **/ - public function addOrUpdateObject($values = [], $options = []) - { - - $lib = new PluginDatainjectionCommonInjectionLib($this, $values, $options); - $lib->processAddOrUpdate(); - return $lib->getInjectionResults(); - } -} diff --git a/inc/mapping.class.php b/inc/mapping.class.php index d92d314a..b484d328 100644 --- a/inc/mapping.class.php +++ b/inc/mapping.class.php @@ -35,7 +35,7 @@ class PluginDatainjectionMapping extends CommonDBTM { - public static $rightname = "plugin_datainjection_model"; + public static string $rightname = "plugin_datainjection_model"; /** * @param string $field diff --git a/inc/menu.class.php b/inc/menu.class.php index 7d5a6f66..95d02e50 100644 --- a/inc/menu.class.php +++ b/inc/menu.class.php @@ -30,7 +30,7 @@ class PluginDatainjectionMenu extends CommonGLPI { - public static $rightname = 'plugin_datainjection_use'; + public static string $rightname = 'plugin_datainjection_use'; public static function getMenuName() { diff --git a/inc/model.class.php b/inc/model.class.php index 112f72f7..2c115cde 100644 --- a/inc/model.class.php +++ b/inc/model.class.php @@ -64,7 +64,7 @@ class PluginDatainjectionModel extends CommonDBTM { - public static $rightname = "plugin_datainjection_model"; + public static string $rightname = "plugin_datainjection_model"; //Store mappings informations private $mappings; @@ -76,7 +76,7 @@ class PluginDatainjectionModel extends CommonDBTM protected $infos; //Do history (CommonDBTM) - public $dohistory = true; + public bool $dohistory = true; //Store specific backend parameters public $specific_model; diff --git a/inc/modelcsv.class.php b/inc/modelcsv.class.php index 93000163..54abd45e 100644 --- a/inc/modelcsv.class.php +++ b/inc/modelcsv.class.php @@ -60,13 +60,13 @@ class PluginDatainjectionModelcsv extends CommonDBChild { - public static $rightname = "plugin_datainjection_model"; + public static string $rightname = "plugin_datainjection_model"; public $specific_fields; // From CommonDBChild - public static $itemtype = 'PluginDatainjectionModel'; - public static $items_id = 'models_id'; - public $dohistory = true; + public static string $itemtype = 'PluginDatainjectionModel'; + public static string $items_id = 'models_id'; + public bool $dohistory = true; public function getEmpty() diff --git a/inc/profile.class.php b/inc/profile.class.php index 8ad92d4b..60396feb 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -30,7 +30,7 @@ class PluginDatainjectionProfile extends Profile { - public static $rightname = "profile"; + public static string $rightname = "profile"; public static function getAllRights() { @@ -103,10 +103,10 @@ public static function addDefaultProfileInfos($profiles_id, $rights) $profileRight = new ProfileRight(); foreach ($rights as $right => $value) { if ( - !countElementsInTable( + countElementsInTable( 'glpi_profilerights', ['profiles_id' => $profiles_id, 'name' => $right], - ) + ) === 0 ) { $myright['profiles_id'] = $profiles_id; $myright['name'] = $right; diff --git a/inc/softwarelicenseinjection.class.php b/inc/softwarelicenseinjection.class.php index 450b55be..577ce51c 100644 --- a/inc/softwarelicenseinjection.class.php +++ b/inc/softwarelicenseinjection.class.php @@ -157,20 +157,21 @@ public function getValueForAdditionalMandatoryFields($fields_toinject = []) return $fields_toinject; } - $query = "SELECT `id` - FROM `glpi_softwares` - WHERE `name` = '" . $fields_toinject['SoftwareLicense']['softwares_id'] . "'" . - getEntitiesRestrictRequest( - " AND", - "glpi_softwares", - "entities_id", - $fields_toinject['SoftwareLicense']['entities_id'], - true, - ); - $result = $DB->doQuery($query); - - if ($DB->numrows($result) > 0) { - $id = $DB->result($result, 0, 'id'); + $result = $DB->request([ + 'SELECT' => ['id'], + 'FROM' => 'glpi_softwares', + 'WHERE' => [ + 'name' => $fields_toinject['SoftwareLicense']['softwares_id'], + ] + getEntitiesRestrictCriteria( + 'glpi_softwares', + 'entities_id', + $fields_toinject['SoftwareLicense']['entities_id'], + true, + ), + ]); + + if (count($result) > 0) { + $id = $result->current()['id']; //Add softwares_id to the array $fields_toinject['SoftwareLicense']['softwares_id'] = $id; } else { diff --git a/inc/softwareversioninjection.class.php b/inc/softwareversioninjection.class.php index 4e391791..f0d2cebd 100644 --- a/inc/softwareversioninjection.class.php +++ b/inc/softwareversioninjection.class.php @@ -152,20 +152,21 @@ public function getValueForAdditionalMandatoryFields($fields_toinject = []) return $fields_toinject; } - $query = "SELECT `id` - FROM `glpi_softwares` - WHERE `name` = '" . $fields_toinject['SoftwareVersion']['softwares_id'] . "'" . - getEntitiesRestrictRequest( - " AND", - "glpi_softwares", - "entities_id", - $fields_toinject['SoftwareVersion']['entities_id'], - true, - ); - $result = $DB->doQuery($query); - - if ($DB->numrows($result) > 0) { - $id = $DB->result($result, 0, 'id'); + $result = $DB->request([ + 'SELECT' => ['id'], + 'FROM' => 'glpi_softwares', + 'WHERE' => [ + 'name' => $fields_toinject['SoftwareVersion']['softwares_id'], + ] + getEntitiesRestrictCriteria( + 'glpi_softwares', + 'entities_id', + $fields_toinject['SoftwareVersion']['entities_id'], + true, + ), + ]); + + if (count($result) > 0) { + $id = $result->current()['id']; //Add softwares_id to the array $fields_toinject['SoftwareVersion']['softwares_id'] = $id; } else { diff --git a/inc/userinjection.class.php b/inc/userinjection.class.php index f5ab1fc7..76a439d0 100644 --- a/inc/userinjection.class.php +++ b/inc/userinjection.class.php @@ -204,7 +204,7 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) 'is_default' => 0, ]; // If user has no emails, set this one as default - if (!countElementsInTable("glpi_useremails", ['users_id' => $values['User']['id']])) { + if (countElementsInTable("glpi_useremails", ['users_id' => $values['User']['id']]) === 0) { $tmp['is_default'] = 1; } $useremail->add($tmp); diff --git a/setup.php b/setup.php index 7cb92eb0..046607a8 100644 --- a/setup.php +++ b/setup.php @@ -34,9 +34,9 @@ define('PLUGIN_DATAINJECTION_VERSION', '2.15.10'); // Minimal GLPI version, inclusive -define("PLUGIN_DATAINJECTION_MIN_GLPI", "11.0.5"); +define("PLUGIN_DATAINJECTION_MIN_GLPI", "12.0.0"); // Maximum GLPI version, exclusive -define("PLUGIN_DATAINJECTION_MAX_GLPI", "11.0.99"); +define("PLUGIN_DATAINJECTION_MAX_GLPI", "12.0.99"); if (!defined("PLUGIN_DATAINJECTION_UPLOAD_DIR")) { define("PLUGIN_DATAINJECTION_UPLOAD_DIR", GLPI_PLUGIN_DOC_DIR . "/datainjection/"); @@ -161,7 +161,6 @@ function getTypesToInject(): void 'PluginDatainjectionNetworkport_VlanInjection' => 'datainjection', 'PluginDatainjectionNetworkNameInjection' => 'datainjection', 'PluginDatainjectionNetpointInjection' => 'datainjection', - 'PluginDatainjectionKnowbaseItemCategoryInjection' => 'datainjection', 'PluginDatainjectionKnowbaseItemInjection' => 'datainjection', 'PluginDatainjectionITILFollowupTemplateInjection' => 'datainjection', 'PluginDatainjectionITILCategoryInjection' => 'datainjection', diff --git a/templates/clientinjection.html.twig b/templates/clientinjection.html.twig index 590b9cae..5427a2b8 100644 --- a/templates/clientinjection.html.twig +++ b/templates/clientinjection.html.twig @@ -32,7 +32,6 @@ {% set rand = random() %}
-
diff --git a/templates/clientinjection_result.html.twig b/templates/clientinjection_result.html.twig index 15ca3f22..7217a5d1 100644 --- a/templates/clientinjection_result.html.twig +++ b/templates/clientinjection_result.html.twig @@ -27,7 +27,6 @@ #} -
{{ __("Injection's results", 'datainjection') }} diff --git a/templates/clientinjection_upload_file.html.twig b/templates/clientinjection_upload_file.html.twig index 43ffaa20..f33a49b2 100644 --- a/templates/clientinjection_upload_file.html.twig +++ b/templates/clientinjection_upload_file.html.twig @@ -30,7 +30,6 @@ {% if add_form %} - {% endif %}
diff --git a/templates/mappings_form.html.twig b/templates/mappings_form.html.twig index 1063f0e0..a095ab91 100644 --- a/templates/mappings_form.html.twig +++ b/templates/mappings_form.html.twig @@ -27,7 +27,6 @@ #} - {% if show_preview %} diff --git a/templates/model_validation_form.html.twig b/templates/model_validation_form.html.twig index 18a92093..c9e68b1c 100644 --- a/templates/model_validation_form.html.twig +++ b/templates/model_validation_form.html.twig @@ -27,7 +27,6 @@ #} -
{{ __('Validation', 'datainjection') }} diff --git a/tests/unit/CommonInjectionLibDateTimeTest.php b/tests/unit/CommonInjectionLibDateTimeTest.php index 263ef07b..15b89d24 100644 --- a/tests/unit/CommonInjectionLibDateTimeTest.php +++ b/tests/unit/CommonInjectionLibDateTimeTest.php @@ -32,6 +32,7 @@ use Glpi\Tests\DbTestCase; use Computer; +use PHPUnit\Framework\Attributes\DataProvider; use PluginDatainjectionComputerInjection; use PluginDatainjectionCommonInjectionLib; use ReflectionMethod; @@ -84,9 +85,7 @@ public static function reformatDateTimeProvider(): array ]; } - /** - * @dataProvider reformatDateTimeProvider - */ + #[DataProvider('reformatDateTimeProvider')] public function testReformatDateTime(string $original, string $date_format, string $expected): void { $reformat_datetime = new ReflectionMethod( diff --git a/tests/unit/GroupInjectionTest.php b/tests/unit/GroupInjectionTest.php index 56f27514..3c7c0e7b 100644 --- a/tests/unit/GroupInjectionTest.php +++ b/tests/unit/GroupInjectionTest.php @@ -30,6 +30,7 @@ namespace GlpiPlugin\Datainjection\Tests\Unit; +use PHPUnit\Framework\Attributes\DataProvider; use PluginDatainjectionComputerInjection; use PluginDatainjectionITILCategoryInjection; use Glpi\Tests\DbTestCase; @@ -78,10 +79,7 @@ public static function assignGroupToInjectedAssignableItemProvider(): array ]; } - /** - * - * @dataProvider assignGroupToInjectedAssignableItemProvider - */ + #[DataProvider('assignGroupToInjectedAssignableItemProvider')] public function testAssigneGroupToInjectedAssignableItem( string $group_field, array $injected_data, @@ -162,10 +160,7 @@ public static function groupIsAssignedToInjectedNonAssignableItemProvider(): arr ]; } - /** - * - * @dataProvider groupIsAssignedToInjectedNonAssignableItemProvider - */ + #[DataProvider('groupIsAssignedToInjectedNonAssignableItemProvider')] public function testGroupIsAssignedToInjectedNonAssignableItem( array $injected_data, array $mandatory_fields, @@ -248,8 +243,8 @@ public static function groupIsUpdatedOnExistingAssignableItemProvider(): array * Updating an existing AssignableItem (Computer) via injection must route the group through * the AssignableItem normalisation path and persist it in Group_Item. * - * @dataProvider groupIsUpdatedOnExistingAssignableItemProvider */ + #[DataProvider('groupIsUpdatedOnExistingAssignableItemProvider')] public function testGroupIsUpdatedOnExistingAssignableItem( string $group_field, array $injected_data,