From 8283ddd7f03485abdc8702fcced077bc9dcd1309 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Thu, 26 Jun 2025 16:16:43 +0200 Subject: [PATCH 01/12] Feature GLP11 --- composer.json | 18 +- composer.lock | 624 +++++++++++++++++----------- hook.php | 19 +- setup.php | 6 +- src/Child.php | 8 +- src/Computer.php | 6 - src/DeviceCamera.php | 6 - src/Document.php | 58 +-- src/Example.php | 3 +- src/Filters/ComputerModelFilter.php | 1 + src/Item_DeviceCamera.php | 4 - src/NotificationTargetExample.php | 6 - src/Profile.php | 18 +- src/RuleTest.php | 5 - src/RuleTestCollection.php | 5 - 15 files changed, 451 insertions(+), 336 deletions(-) diff --git a/composer.json b/composer.json index 6d78c2d..ea21372 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,26 @@ { "require": { - "php": ">=7.4" + "php": ">=8.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.86", - "glpi-project/tools": "^0.8.0" + "friendsoftwig/twigcs": "^6.1", + "glpi-project/tools": "^0.8.0", + "php-parallel-lint/php-parallel-lint": "^1.4" }, "config": { "optimize-autoloader": true, "platform": { - "php": "7.4.0" + "php": "8.2.99" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } + }, + "autoload-dev": { + "psr-4": { + "Glpi\\Tools\\": "../../tools/src/" + } } } diff --git a/composer.lock b/composer.lock index 2bbb589..2d59c0e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "168843fcb11ffc870261e03c3ec79771", + "content-hash": "15f2ccb7cb2c566dab3cfefea4e1f773", "packages": [], "packages-dev": [ { @@ -403,16 +403,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.86.0", + "version": "v3.88.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "4a952bd19dc97879b0620f495552ef09b55f7d36" + "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/4a952bd19dc97879b0620f495552ef09b55f7d36", - "reference": "4a952bd19dc97879b0620f495552ef09b55f7d36", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a8d15584bafb0f0d9d938827840060fd4a3ebc99", + "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99", "shasum": "" }, "require": { @@ -423,39 +423,38 @@ "ext-hash": "*", "ext-json": "*", "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.2", + "fidry/cpu-core-counter": "^1.3", "php": "^7.4 || ^8.0", "react/child-process": "^0.6.6", "react/event-loop": "^1.5", - "react/promise": "^3.2", + "react/promise": "^3.3", "react/socket": "^1.16", "react/stream": "^1.4", "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", - "symfony/console": "^5.4.47 || ^6.4.13 || ^7.0", - "symfony/event-dispatcher": "^5.4.45 || ^6.4.13 || ^7.0", - "symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0", - "symfony/finder": "^5.4.45 || ^6.4.17 || ^7.0", - "symfony/options-resolver": "^5.4.45 || ^6.4.16 || ^7.0", - "symfony/polyfill-mbstring": "^1.32", - "symfony/polyfill-php80": "^1.32", - "symfony/polyfill-php81": "^1.32", - "symfony/process": "^5.4.47 || ^6.4.20 || ^7.2", - "symfony/stopwatch": "^5.4.45 || ^6.4.19 || ^7.0" + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0", + "symfony/polyfill-mbstring": "^1.33", + "symfony/polyfill-php80": "^1.33", + "symfony/polyfill-php81": "^1.33", + "symfony/polyfill-php84": "^1.33", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0" }, "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.6", - "infection/infection": "^0.29.14", - "justinrainbow/json-schema": "^5.3 || ^6.4", + "facile-it/paraunit": "^1.3.1 || ^2.7", + "infection/infection": "^0.31.0", + "justinrainbow/json-schema": "^6.5", "keradus/cli-executor": "^2.2", "mikey179/vfsstream": "^1.6.12", "php-coveralls/php-coveralls": "^2.8", - "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", - "phpunit/phpunit": "^9.6.23 || ^10.5.47 || ^11.5.25", - "symfony/polyfill-php84": "^1.32", - "symfony/var-dumper": "^5.4.48 || ^6.4.23 || ^7.3.1", - "symfony/yaml": "^5.4.45 || ^6.4.23 || ^7.3.1" + "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34", + "symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2", + "symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -496,7 +495,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.86.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.88.2" }, "funding": [ { @@ -504,20 +503,75 @@ "type": "github" } ], - "time": "2025-08-13T22:36:21+00:00" + "time": "2025-09-27T00:24:15+00:00" + }, + { + "name": "friendsoftwig/twigcs", + "version": "6.5.0", + "source": { + "type": "git", + "url": "https://github.com/friendsoftwig/twigcs.git", + "reference": "aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/friendsoftwig/twigcs/zipball/aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc", + "reference": "aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "symfony/console": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/filesystem": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/finder": "^4.4 || ^5.3 || ^6.0 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.19", + "symfony/phpunit-bridge": "^7.1.4" + }, + "bin": [ + "bin/twigcs" + ], + "type": "library", + "autoload": { + "psr-4": { + "FriendsOfTwig\\Twigcs\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tristan Maindron", + "email": "tmaindron@gmail.com" + } + ], + "description": "Checkstyle automation for Twig", + "support": { + "issues": "https://github.com/friendsoftwig/twigcs/issues", + "source": "https://github.com/friendsoftwig/twigcs/tree/6.5.0" + }, + "time": "2024-11-27T21:59:24+00:00" }, { "name": "glpi-project/tools", - "version": "0.8.0", + "version": "0.8.1", "source": { "type": "git", "url": "https://github.com/glpi-project/tools.git", - "reference": "7c2dcec105ed3427183bdfd382d785363aade436" + "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/7c2dcec105ed3427183bdfd382d785363aade436", - "reference": "7c2dcec105ed3427183bdfd382d785363aade436", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", + "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", "shasum": "" }, "require": { @@ -560,26 +614,92 @@ "issues": "https://github.com/glpi-project/tools/issues", "source": "https://github.com/glpi-project/tools" }, - "time": "2025-08-26T10:18:38+00:00" + "time": "2025-09-08T09:45:41+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "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/" @@ -606,9 +726,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -662,30 +782,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -706,9 +826,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "react/cache", @@ -1238,29 +1358,29 @@ }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1292,7 +1412,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -1300,56 +1421,51 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "symfony/console", - "version": "v5.4.47", + "version": "v6.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" + "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "url": "https://api.github.com/repos/symfony/console/zipball/492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", + "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "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" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "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": { @@ -1383,7 +1499,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.47" + "source": "https://github.com/symfony/console/tree/v6.4.26" }, "funding": [ { @@ -1394,29 +1510,33 @@ "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": "2024-11-06T11:30:55+00:00" + "time": "2025-09-26T12:13:46+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.4", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { @@ -1425,7 +1545,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -1450,7 +1570,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -1466,48 +1586,43 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.45", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" + "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7dc69e71de420ac04bc9ab830cf3ffebba48191", + "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1535,7 +1650,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.3" }, "funding": [ { @@ -1546,34 +1661,35 @@ "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": "2024-09-25T14:11:13+00:00" + "time": "2025-08-13T11:49:31+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.4", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f" + "reference": "59eb412e93815df44f05f342958efa9f46b1e586" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", - "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "thanks": { @@ -1581,7 +1697,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -1614,7 +1730,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" }, "funding": [ { @@ -1630,30 +1746,29 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.45", + "version": "v7.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", - "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1681,7 +1796,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.45" + "source": "https://github.com/symfony/filesystem/tree/v7.3.2" }, "funding": [ { @@ -1692,31 +1807,36 @@ "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": "2024-10-22T13:05:35+00:00" + "time": "2025-07-07T08:17:47+00:00" }, { "name": "symfony/finder", - "version": "v5.4.45", + "version": "v7.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "63741784cd7b9967975eec610b256eed3ede022b" + "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", - "reference": "63741784cd7b9967975eec610b256eed3ede022b", + "url": "https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe", + "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1744,7 +1864,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.45" + "source": "https://github.com/symfony/finder/tree/v7.3.2" }, "funding": [ { @@ -1755,32 +1875,34 @@ "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": "2024-09-28T13:32:08+00:00" + "time": "2025-07-15T13:41:35+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.45", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", + "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1813,7 +1935,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" }, "funding": [ { @@ -1824,12 +1946,16 @@ "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": "2024-09-25T14:11:13+00:00" + "time": "2025-08-05T10:16:07+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2167,17 +2293,17 @@ "time": "2024-12-23T08:48:59+00:00" }, { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-php80", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -2195,7 +2321,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "classmap": [ "Resources/stubs" @@ -2206,6 +2332,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2215,7 +2345,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2224,7 +2354,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" }, "funding": [ { @@ -2244,20 +2374,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { - "name": "symfony/polyfill-php80", + "name": "symfony/polyfill-php81", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { @@ -2275,7 +2405,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, "classmap": [ "Resources/stubs" @@ -2286,10 +2416,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2299,7 +2425,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2308,7 +2434,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" }, "funding": [ { @@ -2328,20 +2454,20 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php81", + "name": "symfony/polyfill-php84", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", "shasum": "" }, "require": { @@ -2359,7 +2485,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" + "Symfony\\Polyfill\\Php84\\": "" }, "classmap": [ "Resources/stubs" @@ -2379,7 +2505,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2388,7 +2514,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" }, "funding": [ { @@ -2408,25 +2534,24 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-06-24T13:30:11+00:00" }, { "name": "symfony/process", - "version": "v5.4.47", + "version": "v7.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" + "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", - "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", + "url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b", + "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -2454,7 +2579,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.47" + "source": "https://github.com/symfony/process/tree/v7.3.4" }, "funding": [ { @@ -2465,38 +2590,39 @@ "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": "2024-11-06T11:36:42+00:00" + "time": "2025-09-11T10:12:26+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.4", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", - "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "thanks": { @@ -2504,13 +2630,16 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2537,7 +2666,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -2553,25 +2682,25 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.45", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", - "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -2599,7 +2728,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" + "source": "https://github.com/symfony/stopwatch/tree/v7.3.0" }, "funding": [ { @@ -2615,38 +2744,38 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2025-02-24T10:49:57+00:00" }, { "name": "symfony/string", - "version": "v5.4.47", + "version": "v7.3.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" + "reference": "f96476035142921000338bad71e5247fbc138872" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", - "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", + "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", + "reference": "f96476035142921000338bad71e5247fbc138872", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/emoji": "^7.1", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2685,7 +2814,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.47" + "source": "https://github.com/symfony/string/tree/v7.3.4" }, "funding": [ { @@ -2696,36 +2825,39 @@ "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": "2024-11-10T20:33:58+00:00" + "time": "2025-09-11T14:36:48+00:00" }, { "name": "twig/twig", - "version": "v3.11.3", + "version": "v3.21.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e" + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e", - "reference": "3b06600ff3abefaf8ff55d5c336cd1c4253f8c7e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/285123877d4dd97dd7c11842ac5fb7e86e60d81d", + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php80": "^1.22", - "symfony/polyfill-php81": "^1.29" + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { + "phpstan/phpstan": "^2.0", "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, @@ -2769,7 +2901,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.11.3" + "source": "https://github.com/twigphp/Twig/tree/v3.21.1" }, "funding": [ { @@ -2781,7 +2913,7 @@ "type": "tidelift" } ], - "time": "2024-11-07T12:34:41+00:00" + "time": "2025-05-03T07:21:55+00:00" } ], "aliases": [], @@ -2790,11 +2922,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4" + "php": ">=8.2" }, "platform-dev": {}, "platform-overrides": { - "php": "7.4.0" + "php": "8.2.99" }, "plugin-api-version": "2.6.0" } diff --git a/hook.php b/hook.php index 2484b2e..7f3259a 100644 --- a/hook.php +++ b/hook.php @@ -33,9 +33,7 @@ // Purpose of file: // ---------------------------------------------------------------------- -use GlpiPlugin\Example\Dropdown; use GlpiPlugin\Example\Example; -use Dropdown as GlpiDropdown; function plugin_change_profile_example() { @@ -72,7 +70,6 @@ function plugin_example_getAddSearchOptions($itemtype) $sopt[1001]['linkfield'] = 'plugin_example_dropdowns_id'; $sopt[1001]['name'] = __('Example plugin', 'example'); } - return $sopt; } @@ -89,7 +86,6 @@ function plugin_example_getAddSearchOptionsNew($itemtype) 'name' => __('Example plugin new', 'example'), ]; } - return $options; } @@ -201,7 +197,6 @@ function plugin_example_forceGroupBy($type) // Force add GROUP BY IN REQUEST return true; } - return false; } @@ -250,7 +245,7 @@ function plugin_example_addHaving($link, $nott, $type, $ID, $val, $num) $ADD = " OR ITEM_$num IS NULL"; } - return " $LINK ( ITEM_" . $num . $SEARCH . " $ADD ) "; + return " $link ( ITEM_" . $num . $SEARCH . " $ADD ) "; } return ''; @@ -338,7 +333,6 @@ function plugin_example_MassiveActionsFieldsDisplay($options = []) return true; } } - // Need to return false on non display item return false; } @@ -616,7 +610,6 @@ function plugin_example_install() // To be called for each task the plugin manage // task in class CronTask::Register(Example::class, 'Sample', DAY_TIMESTAMP, ['param' => 50]); - return true; } @@ -710,7 +703,7 @@ function plugin_example_postinit() * * @param $datas array * - * @return un tableau + * @return array **/ function plugin_retrieve_more_data_from_ldap_example(array $datas) { @@ -723,7 +716,7 @@ function plugin_retrieve_more_data_from_ldap_example(array $datas) * * @param $fields array * - * @return un tableau + * @return array **/ function plugin_retrieve_more_field_from_ldap_example($fields) { @@ -744,7 +737,6 @@ function plugin_example_Status($param) $param['ok'] = false; } echo "\n"; - return $param; } @@ -790,12 +782,15 @@ function plugin_example_filter_actors(array $params = []): array function plugin_example_set_impact_icon(array $params) { + /** @var array $CFG_GLPI */ + global $CFG_GLPI; + $itemtype = $params['itemtype']; $items_id = $params['items_id']; $item = getItemForItemtype($itemtype); if ($item instanceof Computer && $item->getFromDB($items_id)) { - return Plugin::getWebDir('example', true, false) . '/public/computer_icon.svg'; + return $CFG_GLPI['root_doc'] . '/plugins/example/public/computer_icon.svg'; } return null; diff --git a/setup.php b/setup.php index 8d71794..553e8d4 100644 --- a/setup.php +++ b/setup.php @@ -42,9 +42,9 @@ define('PLUGIN_EXAMPLE_VERSION', '0.0.1'); // Minimal GLPI version, inclusive -define('PLUGIN_EXAMPLE_MIN_GLPI', '10.0.0'); +define('PLUGIN_EXAMPLE_MIN_GLPI', '11.0.0'); // Maximum GLPI version, exclusive -define('PLUGIN_EXAMPLE_MAX_GLPI', '10.0.99'); +define('PLUGIN_EXAMPLE_MAX_GLPI', '11.0.99'); /** * Init hooks of the plugin. @@ -340,7 +340,6 @@ function plugin_example_check_prerequisites() if (false) { return false; } - return true; } @@ -360,6 +359,5 @@ function plugin_example_check_config($verbose = false) if ($verbose) { echo __('Installed / not configured', 'example'); } - return false; } diff --git a/src/Child.php b/src/Child.php index b2960c8..e58a8b4 100644 --- a/src/Child.php +++ b/src/Child.php @@ -59,25 +59,25 @@ class Child extends CommonDBChild // - CommonDBConnexity::HAVE_SAME_RIGHT_ON_ITEM we must have at least update right // on the item // * $mustBeAttached: some CommonDBChild can be free, without any parent. - public static function canCreate() + public static function canCreate(): bool { return (Session::haveRight('internet', UPDATE) && parent::canCreate()); } - public static function canView() + public static function canView(): bool { return (Session::haveRight('internet', READ) && parent::canView()); } - public static function canUpdate() + public static function canUpdate(): bool { return (Session::haveRight('internet', UPDATE) && parent::canUpdate()); } - public static function canDelete() + public static function canDelete(): bool { return (Session::haveRight('internet', DELETE) && parent::canDelete()); diff --git a/src/Computer.php b/src/Computer.php index 31a4cd5..cae1dab 100644 --- a/src/Computer.php +++ b/src/Computer.php @@ -37,12 +37,6 @@ use CommonDBTM; -// Class of the defined type - -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - class Computer extends CommonDBTM { public static function showInfo() diff --git a/src/DeviceCamera.php b/src/DeviceCamera.php index 83e56a1..c71c7a9 100644 --- a/src/DeviceCamera.php +++ b/src/DeviceCamera.php @@ -37,12 +37,6 @@ use CommonDevice; -// Class of the defined type - -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - /// Class DeviceCamera class DeviceCamera extends CommonDevice { diff --git a/src/Document.php b/src/Document.php index 267b40a..8fe331d 100644 --- a/src/Document.php +++ b/src/Document.php @@ -1,30 +1,31 @@ . --------------------------------------------------------------------------- +/** + * ------------------------------------------------------------------------- + * Example plugin for GLPI + * ------------------------------------------------------------------------- + * + * LICENSE + * + * This file is part of Example. + * + * Example is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Example is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Example. If not, see . + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2006-2022 by Example plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/example + * ------------------------------------------------------------------------- */ /** @@ -57,10 +58,9 @@ namespace GlpiPlugin\Example; use Document as GlpiDocument; - -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access this file directly"); -} +use Exception; +use Glpi\Exception\Http\NotFoundHttpException; +use Sabre\DAV\Exception\BadRequest; class Document extends GlpiDocument { diff --git a/src/Example.php b/src/Example.php index 2d1e90c..f87efc3 100644 --- a/src/Example.php +++ b/src/Example.php @@ -38,6 +38,7 @@ use CommonDBTM; use CommonGLPI; use Computer; +use DBmysql; use Html; use Log; use MassiveAction; @@ -487,7 +488,7 @@ public static function processMassiveActionsForOneItemtype( parent::processMassiveActionsForOneItemtype($ma, $item, $ids); } - public static function generateLinkContents($link, CommonDBTM $item) + public static function generateLinkContents($link, CommonDBTM $item, bool $safe_url = true) { if (strstr($link, '[EXAMPLE_ID]')) { $link = str_replace('[EXAMPLE_ID]', $item->getID(), $link); diff --git a/src/Filters/ComputerModelFilter.php b/src/Filters/ComputerModelFilter.php index d97b325..1cb4541 100644 --- a/src/Filters/ComputerModelFilter.php +++ b/src/Filters/ComputerModelFilter.php @@ -48,6 +48,7 @@ public static function getId(): string public static function canBeApplied(string $table): bool { + /** @var DBmysql $DB */ global $DB; return $DB->fieldExists($table, ComputerModel::getForeignKeyField()); diff --git a/src/Item_DeviceCamera.php b/src/Item_DeviceCamera.php index 19ae9fc..25e9311 100644 --- a/src/Item_DeviceCamera.php +++ b/src/Item_DeviceCamera.php @@ -40,10 +40,6 @@ use GlpiPlugin\Example\DeviceCamera; use Item_Devices; -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - /** * Relation between item and devices **/ diff --git a/src/NotificationTargetExample.php b/src/NotificationTargetExample.php index 0bf18c3..d4bc300 100644 --- a/src/NotificationTargetExample.php +++ b/src/NotificationTargetExample.php @@ -32,10 +32,6 @@ use NotificationTarget; -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - // Class NotificationTarget class NotificationTargetExample extends NotificationTarget { @@ -46,8 +42,6 @@ public function getEvents() public function addDataForTemplate($event, $options = []) { - global $DB, $CFG_GLPI; - $this->data['##example.name##'] = __('Example', 'example'); } } diff --git a/src/Profile.php b/src/Profile.php index 17dfa37..0ceeb92 100644 --- a/src/Profile.php +++ b/src/Profile.php @@ -34,17 +34,27 @@ use Html; use Session; -final class Profile extends \Profile +class Profile extends \Profile { public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - return __('Example plugin'); + if ( + $item instanceof \Profile + && $item->getField('id') + ) { + return self::createTabEntry(__('Example plugin')); + } + + return ''; } public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - $profile = new self(); - $profile->showFormExample($item->getID()); + if ($item instanceof self) { + $profile = new self(); + $profile->showFormExample($item->getID()); + } + return true; } public function showFormExample(int $profiles_id): void diff --git a/src/RuleTest.php b/src/RuleTest.php index 3690099..ca2dead 100644 --- a/src/RuleTest.php +++ b/src/RuleTest.php @@ -37,11 +37,6 @@ use Rule; -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - - /** * Rule class store all informations about a GLPI rule : * - description diff --git a/src/RuleTestCollection.php b/src/RuleTestCollection.php index 8f531ad..031ca5f 100644 --- a/src/RuleTestCollection.php +++ b/src/RuleTestCollection.php @@ -37,11 +37,6 @@ use RuleCollection; -if (!defined('GLPI_ROOT')) { - die("Sorry. You can't access directly to this file"); -} - - class RuleTestCollection extends RuleCollection { // From RuleCollection From 78c614533c7b2eea61d7cdea5e6270481458001e Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 16 Jul 2025 10:58:25 +0200 Subject: [PATCH 02/12] phpstan --- composer.json | 5 +- composer.lock | 156 +++++++++++++++++++++++++++++++++++++++++++++++- front/popup.php | 5 -- hook.php | 3 +- phpstan.neon | 18 ++++++ setup.php | 17 ++---- src/Config.php | 1 + src/Example.php | 126 +++++++++++++++++++------------------- 8 files changed, 247 insertions(+), 84 deletions(-) create mode 100644 phpstan.neon diff --git a/composer.json b/composer.json index ea21372..0c59ca3 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,11 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.86", "friendsoftwig/twigcs": "^6.1", + "glpi-project/phpstan-glpi": "^1.0", "glpi-project/tools": "^0.8.0", - "php-parallel-lint/php-parallel-lint": "^1.4" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index 2d59c0e..c995752 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "15f2ccb7cb2c566dab3cfefea4e1f773", + "content-hash": "070379c59aa250fd700474373fd254a3", "packages": [], "packages-dev": [ { @@ -560,6 +560,55 @@ }, "time": "2024-11-27T21:59:24+00:00" }, + { + "name": "glpi-project/phpstan-glpi", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/glpi-project/phpstan-glpi.git", + "reference": "e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/glpi-project/phpstan-glpi/zipball/e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe", + "reference": "e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe", + "shasum": "" + }, + "require": { + "php": ">=7.4", + "phpstan/phpstan": "^2.1", + "symfony/polyfill-php80": "^1.32" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.85", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStanGlpi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan rules for GLPI.", + "support": { + "issues": "https://github.com/glpi-project/phpstan-glpi/issues", + "source": "https://github.com/glpi-project/phpstan-glpi/tree/1.1.1" + }, + "time": "2025-08-11T13:48:13+00:00" + }, { "name": "glpi-project/tools", "version": "0.8.1", @@ -677,6 +726,111 @@ }, "time": "2024-03-27T12:14:49+00:00" }, + { + "name": "phpstan/phpstan", + "version": "2.1.29", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phar-composer-source.git", + "reference": "git" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d618573eed4a1b6b75e37b2e0b65ac65c885d88e", + "reference": "d618573eed4a1b6b75e37b2e0b65ac65c885d88e", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-09-25T06:58:18+00:00" + }, + { + "name": "phpstan/phpstan-deprecation-rules", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "468e02c9176891cc901143da118f09dc9505fc2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f", + "reference": "468e02c9176891cc901143da118f09dc9505fc2f", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.15" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", + "support": { + "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3" + }, + "time": "2025-05-14T10:56:57+00:00" + }, { "name": "psr/container", "version": "2.0.2", diff --git a/front/popup.php b/front/popup.php index a75896b..c5753bb 100644 --- a/front/popup.php +++ b/front/popup.php @@ -47,11 +47,6 @@ Html::popHeader(__('Test rules engine'), $_SERVER['PHP_SELF']); include '../../../front/rulesengine.test.php'; break; - - case 'show_cache': - Html::popHeader(__('Cache information'), $_SERVER['PHP_SELF']); - include '../../../front/rule.cache.php'; - break; } echo "'; diff --git a/hook.php b/hook.php index 7f3259a..0944f5c 100644 --- a/hook.php +++ b/hook.php @@ -350,7 +350,7 @@ function plugin_example_searchOptionsValues($options = []) switch ($table . '.' . $field) { case 'glpi_plugin_example_examples.serial': echo __('Not really specific - Use your own dropdown - Just for example', 'example'); - GlpiDropdown::show( + Dropdown::show( getItemTypeForTable($options['searchoption']['table']), ['value' => $options['value'], 'name' => $options['name'], @@ -729,6 +729,7 @@ function plugin_example_Status($param) // Do checks (no check for example) $ok = true; echo 'example plugin: example'; + if ($ok) { echo '_OK'; } else { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..2006aa0 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,18 @@ +parameters: + parallel: + maximumNumberOfProcesses: 2 + level: 5 + paths: + - front + - src + - hook.php + - setup.php + - report.php + scanDirectories: + - ../../inc + - ../../src + - ../../front + bootstrapFiles: + - ../../stubs/glpi_constants.php + - ../../vendor/autoload.php + diff --git a/setup.php b/setup.php index 553e8d4..1217545 100644 --- a/setup.php +++ b/setup.php @@ -250,9 +250,6 @@ function plugin_init_example() $PLUGIN_HOOKS['status']['example'] = 'plugin_example_Status'; - // CSRF compliance : All actions must be done via POST and forms closed by Html::closeForm(); - $PLUGIN_HOOKS[Hooks::CSRF_COMPLIANT]['example'] = true; - $PLUGIN_HOOKS[Hooks::DISPLAY_CENTRAL]['example'] = 'plugin_example_display_central'; $PLUGIN_HOOKS[Hooks::DISPLAY_LOGIN]['example'] = 'plugin_example_display_login'; $PLUGIN_HOOKS[Hooks::INFOCOM]['example'] = 'plugin_example_infocom_hook'; @@ -267,11 +264,8 @@ function plugin_init_example() $PLUGIN_HOOKS[Hooks::PRE_ITEM_FORM]['example'] = [ItemForm::class, 'preItemForm']; $PLUGIN_HOOKS[Hooks::POST_ITEM_FORM]['example'] = [ItemForm::class, 'postItemForm']; - //TODO: remove check when GLPI 11.0.0 is released - if (version_compare(GLPI_VERSION, '11.0.0', 'ge')) { - $PLUGIN_HOOKS[Hooks::PRE_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'preSection']; - $PLUGIN_HOOKS[Hooks::POST_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'postSection']; - } + $PLUGIN_HOOKS[Hooks::PRE_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'preSection']; + $PLUGIN_HOOKS[Hooks::POST_ITIL_INFO_SECTION]['example'] = [ItemForm::class, 'postSection']; // Add new actions to timeline $PLUGIN_HOOKS[Hooks::TIMELINE_ACTIONS]['example'] = [ @@ -297,11 +291,8 @@ function plugin_init_example() ComputerModelFilter::class, ]; - //TODO: remove check when GLPI 11.0.0 is released - if (version_compare(GLPI_VERSION, '11.0.0', 'ge')) { - // Icon in the impact analysis - $PLUGIN_HOOKS[Hooks::SET_ITEM_IMPACT_ICON]['example'] = 'plugin_example_set_impact_icon'; - } + // Icon in the impact analysis + $PLUGIN_HOOKS[Hooks::SET_ITEM_IMPACT_ICON]['example'] = 'plugin_example_set_impact_icon'; } diff --git a/src/Config.php b/src/Config.php index baf00b3..c6804d7 100644 --- a/src/Config.php +++ b/src/Config.php @@ -96,5 +96,6 @@ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $ $config = new self(); $config->showFormExample(); } + return true; } } diff --git a/src/Example.php b/src/Example.php index f87efc3..eb2d8b0 100644 --- a/src/Example.php +++ b/src/Example.php @@ -35,14 +35,20 @@ namespace GlpiPlugin\Example; +use Central; use CommonDBTM; use CommonGLPI; use Computer; use DBmysql; use Html; +use Item_Disk; use Log; use MassiveAction; +use Notification; +use Phone; +use Preference; use Session; +use Supplier; // Class of the defined type class Example extends CommonDBTM @@ -168,7 +174,7 @@ public static function cronInfo($name) * * @param $task Object of CronTask class for log / stat * - * @return interger + * @return int * >0 : done * <0 : to be run again (not finished) * 0 : nothing to do @@ -212,33 +218,34 @@ public static function item_add_computer(Computer $item) public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if (!$withtemplate) { - switch ($item->getType()) { - case 'Profile': - if ($item->getField('central')) { - return __('Example', 'example'); - } - break; - - case 'Phone': - if ($_SESSION['glpishow_count_on_tabs']) { - return self::createTabEntry( - __('Example', 'example'), - countElementsInTable($this->getTable()), - ); - } - + if ($item instanceof Profile) { + if ($item->getField('central')) { return __('Example', 'example'); + } - case 'ComputerDisk': - case 'Supplier': - return [1 => __('Test Plugin', 'example'), - 2 => __('Test Plugin 2', 'example')]; + } elseif ($item instanceof Phone) { + if ($_SESSION['glpishow_count_on_tabs']) { + return self::createTabEntry( + __('Example', 'example'), + countElementsInTable($this->getTable()), + ); + } - case 'Computer': - case 'Central': - case 'Preference': - case 'Notification': - return [1 => __('Test Plugin', 'example')]; + return __('Example', 'example'); + + } elseif ($item instanceof Item_Disk || $item instanceof Supplier) { + return [ + 1 => __('Test Plugin', 'example'), + 2 => __('Test Plugin 2', 'example'), + ]; + + } elseif ($item instanceof Computer + || $item instanceof Central + || $item instanceof Preference + || $item instanceof Notification) { + return [ + 1 => __('Test Plugin', 'example'), + ]; } } @@ -247,53 +254,46 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - switch ($item->getType()) { - case 'Phone': - echo __('Plugin Example on Phone', 'example'); - break; + if ($item instanceof Phone) { + echo __('Plugin Example on Phone', 'example'); - case 'Central': - echo __('Plugin central action', 'example'); - break; + } elseif ($item instanceof Central) { + echo __('Plugin central action', 'example'); - case 'Preference': - // Complete form display - $data = plugin_version_example(); + } elseif ($item instanceof Preference) { + // Complete form display + $data = plugin_version_example(); - echo "
"; - echo ""; - echo "'; + echo ""; + echo "
" . $data['name'] . ' - ' . $data['version']; - echo '
"; + echo "'; - echo ""; - echo ''; + echo ""; + echo ''; - echo ""; - echo ''; + echo ""; + echo ''; - echo '
" . $data['name'] . ' - ' . $data['version']; + echo '
Name of the prefInput to set the pref
Name of the prefInput to set the pref
'; - echo '
'; - break; + echo ''; + echo ''; - case 'Notification': - echo __('Plugin mailing action', 'example'); - break; + } elseif ($item instanceof Notification) { + echo __('Plugin mailing action', 'example'); - case 'ComputerDisk': - case 'Supplier': - if ($tabnum == 1) { - echo __('First tab of Plugin example', 'example'); - } else { - echo __('Second tab of Plugin example', 'example'); - } - break; + } elseif ($item instanceof Item_Disk || $item instanceof Supplier) { + if ($tabnum == 1) { + echo __('First tab of Plugin example', 'example'); + } else { + echo __('Second tab of Plugin example', 'example'); + } - default: - //TRANS: %1$s is a class name, %2$d is an item ID - printf(__('Plugin example CLASS=%1$s id=%2$d', 'example'), $item->getType(), $item->getField('id')); - break; + } else { + //TRANS: %1$s is a class name, %2$d is an item ID + printf(__('Plugin example CLASS=%1$s', 'example'), get_class($item)); } + return true; } @@ -338,7 +338,7 @@ public static function populatePlanning($parm) * @param $type position of the item in the time block (in, through, begin or end) * @param $complete complete display (more details) * - * @return Nothing (display function) + * @return void (display function) **/ public static function displayPlanningItem(array $val, $who, $type = '', $complete = 0) { @@ -491,7 +491,7 @@ public static function processMassiveActionsForOneItemtype( public static function generateLinkContents($link, CommonDBTM $item, bool $safe_url = true) { if (strstr($link, '[EXAMPLE_ID]')) { - $link = str_replace('[EXAMPLE_ID]', $item->getID(), $link); + $link = str_replace('[EXAMPLE_ID]', (string) $item->getID(), $link); return [$link]; } From b36d4a7b41a71227897c2a7614b025e136fc084e Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 16 Jul 2025 11:09:47 +0200 Subject: [PATCH 03/12] enable CI and fix phstanneon --- .github/workflows/continuous-integration.yml | 35 ++++++++++++++++++++ phpstan.neon | 1 + 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..850f448 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,35 @@ +name: "Continuous integration" + +on: + push: + branches: + - "main" + tags: + - "*" + pull_request: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + generate-ci-matrix: + name: "Generate CI matrix" + uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1" + with: + glpi-version: "11.0.x" + ci: + name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" + needs: "generate-ci-matrix" + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }} + uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1" + with: + plugin-key: "fields" + glpi-version: "${{ matrix.glpi-version }}" + php-version: "${{ matrix.php-version }}" + db-image: "${{ matrix.db-image }}" diff --git a/phpstan.neon b/phpstan.neon index 2006aa0..7eca827 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,6 +8,7 @@ parameters: - hook.php - setup.php - report.php + - stat.php scanDirectories: - ../../inc - ../../src From db19d1882eb0354194e17d2ab4d0a527ae16505c Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 16 Jul 2025 11:46:54 +0200 Subject: [PATCH 04/12] Update .github/workflows/continuous-integration.yml Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 850f448..0d446fc 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -29,7 +29,7 @@ jobs: matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }} uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1" with: - plugin-key: "fields" + plugin-key: "example" glpi-version: "${{ matrix.glpi-version }}" php-version: "${{ matrix.php-version }}" db-image: "${{ matrix.db-image }}" From 48ca820cff9894383c2419b0e8e3c24b9248de4d Mon Sep 17 00:00:00 2001 From: Stanislas Date: Wed, 16 Jul 2025 11:47:00 +0200 Subject: [PATCH 05/12] Update phpstan.neon Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 7eca827..8cf33ad 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,8 +6,8 @@ parameters: - front - src - hook.php - - setup.php - report.php + - setup.php - stat.php scanDirectories: - ../../inc From 576e887411887e821c8878c07e8feee7020b6175 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Wed, 10 Sep 2025 08:25:46 +0200 Subject: [PATCH 06/12] Pass all paramters to parent call --- src/Example.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Example.php b/src/Example.php index eb2d8b0..35a1b7c 100644 --- a/src/Example.php +++ b/src/Example.php @@ -496,7 +496,7 @@ public static function generateLinkContents($link, CommonDBTM $item, bool $safe_ return [$link]; } - return parent::generateLinkContents($link, $item); + return parent::generateLinkContents($link, $item, $safe_url); } public static function dashboardTypes() From 4e12f6c160569f4ae88394adfc6250ab546cedfe Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 10 Sep 2025 09:31:38 +0200 Subject: [PATCH 07/12] move query -> doQuery --- hook.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hook.php b/hook.php index 0944f5c..3cb36ed 100644 --- a/hook.php +++ b/hook.php @@ -545,7 +545,7 @@ function plugin_example_install() PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - $DB->query($query) or die('error creating glpi_plugin_example_examples ' . $DB->error()); + $DB->doQuery($query); $query = "INSERT INTO `glpi_plugin_example_examples` (`id`, `name`, `serial`, `plugin_example_dropdowns_id`, `is_deleted`, @@ -553,7 +553,7 @@ function plugin_example_install() VALUES (1, 'example 1', 'serial 1', 1, 0, 0, NULL), (2, 'example 2', 'serial 2', 2, 0, 0, NULL), (3, 'example 3', 'serial 3', 1, 0, 0, NULL)"; - $DB->query($query) or die('error populate glpi_plugin_example ' . $DB->error()); + $DB->doQuery($query); } if (!$DB->tableExists('glpi_plugin_example_dropdowns')) { @@ -565,14 +565,14 @@ function plugin_example_install() KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - $DB->query($query) or die('error creating glpi_plugin_example_dropdowns' . $DB->error()); + $DB->doQuery($query); $query = "INSERT INTO `glpi_plugin_example_dropdowns` (`id`, `name`, `comment`) VALUES (1, 'dp 1', 'comment 1'), (2, 'dp2', 'comment 2')"; - $DB->query($query) or die('error populate glpi_plugin_example_dropdowns' . $DB->error()); + $DB->doQuery($query); } if (!$DB->tableExists('glpi_plugin_example_devicecameras')) { @@ -586,7 +586,7 @@ function plugin_example_install() KEY `manufacturers_id` (`manufacturers_id`) ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - $DB->query($query) or die('error creating glpi_plugin_example_examples ' . $DB->error()); + $DB->doQuery($query); } if (!$DB->tableExists('glpi_plugin_example_items_devicecameras')) { @@ -604,7 +604,7 @@ function plugin_example_install() KEY `is_dynamic` (`is_dynamic`) ) ENGINE=InnoDB DEFAULT CHARSET={$default_charset} COLLATE={$default_collation} ROW_FORMAT=DYNAMIC;"; - $DB->query($query) or die('error creating glpi_plugin_example_examples ' . $DB->error()); + $DB->doQuery($query); } // To be called for each task the plugin manage From 8e81b1a8ae5c8d823a068ce18bd71c3161336b16 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Wed, 10 Sep 2025 09:45:02 +0200 Subject: [PATCH 08/12] fix direct query --- hook.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hook.php b/hook.php index 3cb36ed..da8e653 100644 --- a/hook.php +++ b/hook.php @@ -638,28 +638,28 @@ function plugin_example_uninstall() // Old version tables if ($DB->tableExists('glpi_dropdown_plugin_example')) { $query = 'DROP TABLE `glpi_dropdown_plugin_example`'; - $DB->query($query) or die('error deleting glpi_dropdown_plugin_example'); + $DB->doQuery($query); } if ($DB->tableExists('glpi_plugin_example')) { $query = 'DROP TABLE `glpi_plugin_example`'; - $DB->query($query) or die('error deleting glpi_plugin_example'); + $DB->doQuery($query); } // Current version tables if ($DB->tableExists('glpi_plugin_example_example')) { $query = 'DROP TABLE `glpi_plugin_example_example`'; - $DB->query($query) or die('error deleting glpi_plugin_example_example'); + $DB->doQuery($query); } if ($DB->tableExists('glpi_plugin_example_dropdowns')) { $query = 'DROP TABLE `glpi_plugin_example_dropdowns`;'; - $DB->query($query) or die('error deleting glpi_plugin_example_dropdowns'); + $DB->doQuery($query); } if ($DB->tableExists('glpi_plugin_example_devicecameras')) { $query = 'DROP TABLE `glpi_plugin_example_devicecameras`;'; - $DB->query($query) or die('error deleting glpi_plugin_example_devicecameras'); + $DB->doQuery($query); } if ($DB->tableExists('glpi_plugin_example_items_devicecameras')) { $query = 'DROP TABLE `glpi_plugin_example_items_devicecameras`;'; - $DB->query($query) or die('error deleting glpi_plugin_example_items_devicecameras'); + $DB->doQuery($query); } return true; From 18efd110f6f12bdf645d9b12c614305a46b50bdd Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Tue, 30 Sep 2025 16:00:10 +0200 Subject: [PATCH 09/12] release GLPI 11.0 --- CHANGELOG.md | 12 ++++++++++++ example.xml | 4 ++++ setup.php | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4079509 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +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/). + +## [0.1.0] - 2025-09-30 + +### Added + +- GLPI 11 compatibility diff --git a/example.xml b/example.xml index 583311c..a84001d 100644 --- a/example.xml +++ b/example.xml @@ -24,6 +24,10 @@ Indepnet + + 0.1.0 + ~11.0.0 + 0.0.1 ~10.0.0 diff --git a/setup.php b/setup.php index 1217545..5342585 100644 --- a/setup.php +++ b/setup.php @@ -39,7 +39,7 @@ use GlpiPlugin\Example\RuleTestCollection; use GlpiPlugin\Example\Showtabitem; -define('PLUGIN_EXAMPLE_VERSION', '0.0.1'); +define('PLUGIN_EXAMPLE_VERSION', '0.1.0'); // Minimal GLPI version, inclusive define('PLUGIN_EXAMPLE_MIN_GLPI', '11.0.0'); From 54bbad7f899d1a8097ba0b5140c2d267ff41bb6c Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Tue, 30 Sep 2025 16:02:33 +0200 Subject: [PATCH 10/12] Clean composer.json --- composer.json | 13 +- composer.lock | 2551 ++++--------------------------------------------- 2 files changed, 177 insertions(+), 2387 deletions(-) diff --git a/composer.json b/composer.json index 0c59ca3..8b1e015 100644 --- a/composer.json +++ b/composer.json @@ -3,23 +3,14 @@ "php": ">=8.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.86", - "friendsoftwig/twigcs": "^6.1", - "glpi-project/phpstan-glpi": "^1.0", - "glpi-project/tools": "^0.8.0", - "php-parallel-lint/php-parallel-lint": "^1.4", - "phpstan/phpstan": "^2.1", - "phpstan/phpstan-deprecation-rules": "^2.0" + "glpi-project/tools": "^0.8" }, "config": { "optimize-autoloader": true, "platform": { "php": "8.2.99" }, - "sort-packages": true, - "allow-plugins": { - "phpstan/extension-installer": true - } + "sort-packages": true }, "autoload-dev": { "psr-4": { diff --git a/composer.lock b/composer.lock index c995752..07dddba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,257 +4,91 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "070379c59aa250fd700474373fd254a3", + "content-hash": "0bb7734a8837cdd118f20d259d3613e7", "packages": [], "packages-dev": [ { - "name": "clue/ndjson-react", - "version": "v1.3.0", + "name": "glpi-project/tools", + "version": "0.8.1", "source": { "type": "git", - "url": "https://github.com/clue/reactphp-ndjson.git", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + "url": "https://github.com/glpi-project/tools.git", + "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", - "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", + "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", "shasum": "" }, "require": { - "php": ">=5.3", - "react/stream": "^1.2" + "symfony/console": "^5.4 || ^6.0", + "twig/twig": "^3.3" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/event-loop": "^1.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Clue\\React\\NDJson\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", - "homepage": "https://github.com/clue/reactphp-ndjson", - "keywords": [ - "NDJSON", - "json", - "jsonlines", - "newline", - "reactphp", - "streaming" - ], - "support": { - "issues": "https://github.com/clue/reactphp-ndjson/issues", - "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + "nikic/php-parser": "^4.13", + "phpstan/phpstan-src": "^1.10" }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } + "bin": [ + "bin/extract-locales", + "bin/licence-headers-check", + "tools/plugin-release" ], - "time": "2022-12-23T10:58:28+00:00" - }, - { - "name": "composer/pcre", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<1.11.10" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", - "phpunit/phpunit": "^8 || ^9" - }, "type": "library", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - }, - "branch-alias": { - "dev-main": "3.x-dev" - } - }, "autoload": { "psr-4": { - "Composer\\Pcre\\": "src" + "GlpiProject\\Tools\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "GPL-3.0-or-later" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Teclib'", + "email": "glpi@teclib.com", + "homepage": "http://teclib-group.com" } ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "description": "Various tools for GLPI and its plugins", "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" + "glpi", + "plugins", + "tools" ], "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" + "issues": "https://github.com/glpi-project/tools/issues", + "source": "https://github.com/glpi-project/tools" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-11-12T16:29:46+00:00" + "time": "2025-09-08T09:45:41+00:00" }, { - "name": "composer/semver", - "version": "3.4.4", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" + "dev-master": "2.0.x-dev" } - ], - "time": "2025-08-20T19:15:30+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", - "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, - "type": "library", "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -263,116 +97,77 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Restarts a process without Xdebug.", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "Xdebug", - "performance" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-05-06T16:37:16+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "evenement/evenement", - "version": "v3.0.2", + "name": "symfony/console", + "version": "v6.4.26", "source": { "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + "url": "https://github.com/symfony/console.git", + "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "url": "https://api.github.com/repos/symfony/console/zipball/492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", + "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", "shasum": "" }, "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^9 || ^6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Evenement\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ], - "support": { - "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/v3.0.2" - }, - "time": "2023-08-08T05:53:35+00:00" - }, - { - "name": "fidry/cpu-core-counter", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + "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" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", - "reference": "db9508f7b1474469d9d3c53b86f817e344732678", - "shasum": "" + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, - "require": { - "php": "^7.2 || ^8.0" + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "fidry/makefile": "^0.2.0", - "fidry/php-cs-fixer-config": "^1.1.2", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^2.0", - "phpstan/phpstan-deprecation-rules": "^2.0.0", - "phpstan/phpstan-phpunit": "^2.0", - "phpstan/phpstan-strict-rules": "^2.0", - "phpunit/phpunit": "^8.5.31 || ^9.5.26", - "webmozarts/strict-phpunit": "^7.5" + "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": { - "Fidry\\CpuCoreCounter\\": "src/" - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -380,1881 +175,24 @@ ], "authors": [ { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" - }, - "funding": [ + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, { - "url": "https://github.com/theofidry", - "type": "github" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "time": "2025-08-14T07:29:31+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.88.2", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a8d15584bafb0f0d9d938827840060fd4a3ebc99", - "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99", - "shasum": "" - }, - "require": { - "clue/ndjson-react": "^1.3", - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.5", - "ext-filter": "*", - "ext-hash": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.3", - "php": "^7.4 || ^8.0", - "react/child-process": "^0.6.6", - "react/event-loop": "^1.5", - "react/promise": "^3.3", - "react/socket": "^1.16", - "react/stream": "^1.4", - "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", - "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0", - "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/polyfill-mbstring": "^1.33", - "symfony/polyfill-php80": "^1.33", - "symfony/polyfill-php81": "^1.33", - "symfony/polyfill-php84": "^1.33", - "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2", - "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.7", - "infection/infection": "^0.31.0", - "justinrainbow/json-schema": "^6.5", - "keradus/cli-executor": "^2.2", - "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.8", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", - "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34", - "symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2", - "symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "exclude-from-classmap": [ - "src/Fixer/Internal/*" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.88.2" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2025-09-27T00:24:15+00:00" - }, - { - "name": "friendsoftwig/twigcs", - "version": "6.5.0", - "source": { - "type": "git", - "url": "https://github.com/friendsoftwig/twigcs.git", - "reference": "aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/friendsoftwig/twigcs/zipball/aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc", - "reference": "aaa3ba112bf4fcee7b51a00d9b45b13bc2cc23bc", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", - "symfony/console": "^4.4 || ^5.3 || ^6.0 || ^7.0", - "symfony/filesystem": "^4.4 || ^5.3 || ^6.0 || ^7.0", - "symfony/finder": "^4.4 || ^5.3 || ^6.0 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6.19", - "symfony/phpunit-bridge": "^7.1.4" - }, - "bin": [ - "bin/twigcs" - ], - "type": "library", - "autoload": { - "psr-4": { - "FriendsOfTwig\\Twigcs\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tristan Maindron", - "email": "tmaindron@gmail.com" - } - ], - "description": "Checkstyle automation for Twig", - "support": { - "issues": "https://github.com/friendsoftwig/twigcs/issues", - "source": "https://github.com/friendsoftwig/twigcs/tree/6.5.0" - }, - "time": "2024-11-27T21:59:24+00:00" - }, - { - "name": "glpi-project/phpstan-glpi", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/phpstan-glpi.git", - "reference": "e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/phpstan-glpi/zipball/e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe", - "reference": "e98ef833abc1389a0cc69743db5b1f3a7dc8ccfe", - "shasum": "" - }, - "require": { - "php": ">=7.4", - "phpstan/phpstan": "^2.1", - "symfony/polyfill-php80": "^1.32" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.85", - "php-parallel-lint/php-parallel-lint": "^1.4", - "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStanGlpi\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan rules for GLPI.", - "support": { - "issues": "https://github.com/glpi-project/phpstan-glpi/issues", - "source": "https://github.com/glpi-project/phpstan-glpi/tree/1.1.1" - }, - "time": "2025-08-11T13:48:13+00:00" - }, - { - "name": "glpi-project/tools", - "version": "0.8.1", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", - "reference": "cf182b1a6bd1a73c5c6469dbbd0edabf7cb5857e", - "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-09-08T09:45:41+00:00" - }, - { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.3.0" - }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" - }, - "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", - "squizlabs/php_codesniffer": "^3.6" - }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" - }, - "bin": [ - "parallel-lint" - ], - "type": "library", - "autoload": { - "classmap": [ - "./src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" - } - ], - "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", - "keywords": [ - "lint", - "static analysis" - ], - "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" - }, - "time": "2024-03-27T12:14:49+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "2.1.29", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-phar-composer-source.git", - "reference": "git" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d618573eed4a1b6b75e37b2e0b65ac65c885d88e", - "reference": "d618573eed4a1b6b75e37b2e0b65ac65c885d88e", - "shasum": "" - }, - "require": { - "php": "^7.4|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - } - ], - "time": "2025-09-25T06:58:18+00:00" - }, - { - "name": "phpstan/phpstan-deprecation-rules", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "468e02c9176891cc901143da118f09dc9505fc2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/468e02c9176891cc901143da118f09dc9505fc2f", - "reference": "468e02c9176891cc901143da118f09dc9505fc2f", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.15" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", - "support": { - "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.3" - }, - "time": "2025-05-14T10:56:57+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": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, - { - "name": "react/cache", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.2.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2022-11-30T15:59:55+00:00" - }, - { - "name": "react/child-process", - "version": "v0.6.6", - "source": { - "type": "git", - "url": "https://github.com/reactphp/child-process.git", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/event-loop": "^1.2", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/socket": "^1.16", - "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\ChildProcess\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven library for executing child processes with ReactPHP.", - "keywords": [ - "event-driven", - "process", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.6" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2025-01-01T16:37:48+00:00" - }, - { - "name": "react/dns", - "version": "v1.13.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.7 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3 || ^2", - "react/promise-timer": "^1.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Dns\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async DNS resolver for ReactPHP", - "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.13.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-13T14:18:03+00:00" - }, - { - "name": "react/event-loop", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-11-13T13:48:05+00:00" - }, - { - "name": "react/promise", - "version": "v3.3.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", - "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.12.28 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.3.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2025-08-19T18:57:03+00:00" - }, - { - "name": "react/socket", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^1.13", - "react/event-loop": "^1.2", - "react/promise": "^3.2 || ^2.6 || ^1.2.1", - "react/stream": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4.3 || ^3.3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Socket\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" - ], - "support": { - "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.16.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-07-26T10:38:09+00:00" - }, - { - "name": "react/stream", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.2" - }, - "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ], - "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.4.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-11T12:45:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "6.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-07-03T04:53:05+00:00" - }, - { - "name": "symfony/console", - "version": "v6.4.26", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", - "reference": "492de6dfd93910d7d7a729c5a04ddcd2b9e99c4f", - "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.26" - }, - "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": "2025-09-26T12:13:46+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.6-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.6.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:21:43+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v7.3.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7dc69e71de420ac04bc9ab830cf3ffebba48191", - "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/event-dispatcher-contracts": "^2.5|^3" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "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": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.3" - }, - "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": "2025-08-13T11:49:31+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "59eb412e93815df44f05f342958efa9f46b1e586" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", - "reference": "59eb412e93815df44f05f342958efa9f46b1e586", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "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 dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:21:43+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v7.3.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", - "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "require-dev": { - "symfony/process": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.3.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": "2025-07-07T08:17:47+00:00" - }, - { - "name": "symfony/finder", - "version": "v7.3.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe", - "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "symfony/filesystem": "^6.4|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "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": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v7.3.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": "2025-07-15T13:41:35+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v7.3.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "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": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" - }, - "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": "2025-08-05T10:16:07+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", - "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.33.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": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", - "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" - ], + "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/polyfill-intl-grapheme/tree/v1.33.0" + "source": "https://github.com/symfony/console/tree/v6.4.26" }, "funding": [ { @@ -2274,44 +212,38 @@ "type": "tidelift" } ], - "time": "2025-06-27T09:58:17+00:00" + "time": "2025-09-26T12:13:46+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=8.1" }, "type": "library", "extra": { "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" } }, "autoload": { "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2328,18 +260,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -2350,40 +274,35 @@ "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": "2024-09-09T11:45:10+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { - "name": "symfony/polyfill-mbstring", + "name": "symfony/polyfill-ctype", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "ext-iconv": "*", "php": ">=7.2" }, "provide": { - "ext-mbstring": "*" + "ext-ctype": "*" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-ctype": "For best performance" }, "type": "library", "extra": { @@ -2397,7 +316,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -2406,25 +325,24 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -2444,25 +362,28 @@ "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php80", + "name": "symfony/polyfill-intl-grapheme", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { "php": ">=7.2" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "thanks": { @@ -2475,21 +396,14 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2499,16 +413,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "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-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { @@ -2528,25 +444,28 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2025-06-27T09:58:17+00:00" }, { - "name": "symfony/polyfill-php81", + "name": "symfony/polyfill-intl-normalizer", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { "php": ">=7.2" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "thanks": { @@ -2559,7 +478,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, "classmap": [ "Resources/stubs" @@ -2579,16 +498,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "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-php81/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -2611,22 +532,29 @@ "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php84", + "name": "symfony/polyfill-mbstring", "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", - "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "thanks": { @@ -2639,11 +567,8 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php84\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2659,81 +584,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "mbstring", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.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": "2025-06-24T13:30:11+00:00" - }, - { - "name": "symfony/process", - "version": "v7.3.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b", - "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "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": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v7.3.4" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" }, "funding": [ { @@ -2753,7 +614,7 @@ "type": "tidelift" } ], - "time": "2025-09-11T10:12:26+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/service-contracts", @@ -2838,68 +699,6 @@ ], "time": "2025-04-25T09:37:31+00:00" }, - { - "name": "symfony/stopwatch", - "version": "v7.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/service-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "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": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.3.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-02-24T10:49:57+00:00" - }, { "name": "symfony/string", "version": "v7.3.4", From 501dc97a6767c89bbddd1dc6c0008768718c8642 Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Tue, 30 Sep 2025 16:06:28 +0200 Subject: [PATCH 11/12] psalm + rector --- front/config.php | 4 +- front/devicecamera.form.php | 2 +- front/devicecamera.php | 2 +- front/dropdown.form.php | 2 +- front/dropdown.php | 2 +- front/example.form.php | 2 +- front/example.php | 2 +- front/popup.php | 12 ++-- front/ruletest.form.php | 2 +- front/ruletest.php | 2 +- hook.php | 54 +++++++--------- psalm.xml | 24 +++++++ rector.php | 97 +++++++++++++++++++++++++++++ setup.php | 19 +++--- src/Computer.php | 6 +- src/Config.php | 12 ++-- src/DeviceCamera.php | 2 +- src/Document.php | 29 ++++----- src/Dropdown.php | 4 +- src/Example.php | 80 ++++++++++++------------ src/Filters/ComputerModelFilter.php | 2 +- src/ItemForm.php | 24 +++---- src/NotificationTargetExample.php | 2 +- src/Profile.php | 2 +- src/RuleTest.php | 4 +- src/Showtabitem.php | 17 ++--- 26 files changed, 252 insertions(+), 158 deletions(-) create mode 100644 psalm.xml create mode 100644 rector.php diff --git a/front/config.php b/front/config.php index 34dc261..a05f021 100644 --- a/front/config.php +++ b/front/config.php @@ -37,7 +37,7 @@ //header("Location:../../central.php"); // Entry menu case -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkRight('config', UPDATE); @@ -45,5 +45,5 @@ Plugin::load('example'); Html::header('TITRE', $_SERVER['PHP_SELF'], 'config', 'plugins'); -echo __('This is the plugin config page', 'example'); +echo __s('This is the plugin config page', 'example'); Html::footer(); diff --git a/front/devicecamera.form.php b/front/devicecamera.form.php index df30c36..2402500 100644 --- a/front/devicecamera.form.php +++ b/front/devicecamera.form.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\DeviceCamera; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); $dropdown = new DeviceCamera(); diff --git a/front/devicecamera.php b/front/devicecamera.php index 0abc8c0..54f625d 100644 --- a/front/devicecamera.php +++ b/front/devicecamera.php @@ -33,7 +33,7 @@ // Purpose of file: // ---------------------------------------------------------------------- -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); $dropdown = new DeviceCamera(); diff --git a/front/dropdown.form.php b/front/dropdown.form.php index 2c514f7..dae3250 100644 --- a/front/dropdown.form.php +++ b/front/dropdown.form.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\Dropdown; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); Plugin::load('example', true); diff --git a/front/dropdown.php b/front/dropdown.php index 4bb99a4..8271b1d 100644 --- a/front/dropdown.php +++ b/front/dropdown.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\Dropdown; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); Plugin::load('example', true); diff --git a/front/example.form.php b/front/example.form.php index 3180563..e9b8877 100644 --- a/front/example.form.php +++ b/front/example.form.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\Example; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { diff --git a/front/example.php b/front/example.php index da6a757..c4cdc76 100644 --- a/front/example.php +++ b/front/example.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\Example; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkRight(Example::$rightname, READ); if ($_SESSION['glpiactiveprofile']['interface'] == 'central') { diff --git a/front/popup.php b/front/popup.php index c5753bb..0276296 100644 --- a/front/popup.php +++ b/front/popup.php @@ -28,7 +28,7 @@ * ------------------------------------------------------------------------- */ -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); @@ -39,16 +39,16 @@ if (isset($_SESSION['glpipopup']['name'])) { switch ($_SESSION['glpipopup']['name']) { case 'test_rule': - Html::popHeader(__('Test'), $_SERVER['PHP_SELF']); - include '../../../front/rule.test.php'; + Html::popHeader(__s('Test'), $_SERVER['PHP_SELF']); + include __DIR__ . '/../../../front/rule.test.php'; break; case 'test_all_rules': - Html::popHeader(__('Test rules engine'), $_SERVER['PHP_SELF']); - include '../../../front/rulesengine.test.php'; + Html::popHeader(__s('Test rules engine'), $_SERVER['PHP_SELF']); + include __DIR__ . '/../../../front/rulesengine.test.php'; break; } - echo "

" . __('Back') . ''; + echo "'; Html::popFooter(); } diff --git a/front/ruletest.form.php b/front/ruletest.form.php index e48a834..6235f3c 100644 --- a/front/ruletest.form.php +++ b/front/ruletest.form.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\RuleTestCollection; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); $rulecollection = new RuleTestCollection(); diff --git a/front/ruletest.php b/front/ruletest.php index 16ea9e6..22dd6f1 100644 --- a/front/ruletest.php +++ b/front/ruletest.php @@ -35,7 +35,7 @@ use GlpiPlugin\Example\RuleTestCollection; -include('../../../inc/includes.php'); +include(__DIR__ . '/../../../inc/includes.php'); Session::checkLoginUser(); $rulecollection = new RuleTestCollection(); diff --git a/hook.php b/hook.php index da8e653..c7c5983 100644 --- a/hook.php +++ b/hook.php @@ -52,7 +52,7 @@ function plugin_example_getDatabaseRelations() function plugin_example_getDropdown() { // Table => Name - return [Dropdown::class => __('Plugin Example Dropdown', 'example')]; + return [Dropdown::class => __s('Plugin Example Dropdown', 'example')]; } @@ -68,7 +68,7 @@ function plugin_example_getAddSearchOptions($itemtype) $sopt[1001]['table'] = 'glpi_plugin_example_dropdowns'; $sopt[1001]['field'] = 'name'; $sopt[1001]['linkfield'] = 'plugin_example_dropdowns_id'; - $sopt[1001]['name'] = __('Example plugin', 'example'); + $sopt[1001]['name'] = __s('Example plugin', 'example'); } return $sopt; } @@ -83,7 +83,7 @@ function plugin_example_getAddSearchOptionsNew($itemtype) 'table' => 'glpi_plugin_example_dropdowns', 'field' => 'name', 'linkfield' => 'plugin_example_dropdowns_id', - 'name' => __('Example plugin new', 'example'), + 'name' => __s('Example plugin new', 'example'), ]; } return $options; @@ -207,7 +207,7 @@ function plugin_example_addWhere($link, $nott, $type, $ID, $val, $searchtype) $table = $searchopt[$ID]['table']; $field = $searchopt[$ID]['field']; - $SEARCH = Search::makeTextSearch($val, $nott); + Search::makeTextSearch($val, $nott); // Example of standard Where clause but use it ONLY for specific Where // No need of the function if you do not have specific cases @@ -255,8 +255,6 @@ function plugin_example_addHaving($link, $nott, $type, $ID, $val, $num) function plugin_example_addSelect($type, $ID, $num) { $searchopt = &Search::getOptions($type); - $table = $searchopt[$ID]['table']; - $field = $searchopt[$ID]['field']; // Example of standard Select clause but use it ONLY for specific Select // No need of the function if you do not have specific cases @@ -271,8 +269,6 @@ function plugin_example_addSelect($type, $ID, $num) function plugin_example_addOrderBy($type, $ID, $order, $key = 0) { $searchopt = &Search::getOptions($type); - $table = $searchopt[$ID]['table']; - $field = $searchopt[$ID]['field']; // Example of standard OrderBy clause but use it ONLY for specific order by // No need of the function if you do not have specific cases @@ -294,7 +290,7 @@ function plugin_example_MassiveActions($type) switch ($type) { // New action for core and other plugin types : name = plugin_PLUGINNAME_actionname case 'Computer': - return [Example::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'DoIt' => __('plugin_example_DoIt', 'example')]; + return [Example::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'DoIt' => __s('plugin_example_DoIt', 'example')]; // Actions for types provided by the plugin are included inside the classes } @@ -311,13 +307,12 @@ function plugin_example_MassiveActionsFieldsDisplay($options = []) $table = $options['options']['table']; $field = $options['options']['field']; - $linkfield = $options['options']['linkfield']; if ($table == getTableForItemType($options['itemtype'])) { // Table fields switch ($table . '.' . $field) { case 'glpi_plugin_example_examples.serial': - echo __('Not really specific - Just for example', 'example'); + echo __s('Not really specific - Just for example', 'example'); // Dropdown::showYesNo($linkfield); // Need to return true if specific display @@ -327,7 +322,7 @@ function plugin_example_MassiveActionsFieldsDisplay($options = []) // Linked Fields switch ($table . '.' . $field) { case 'glpi_plugin_example_dropdowns.name': - echo __('Not really specific - Just for example', 'example'); + echo __s('Not really specific - Just for example', 'example'); // Need to return true if specific display return true; @@ -349,7 +344,7 @@ function plugin_example_searchOptionsValues($options = []) // Table fields switch ($table . '.' . $field) { case 'glpi_plugin_example_examples.serial': - echo __('Not really specific - Use your own dropdown - Just for example', 'example'); + echo __s('Not really specific - Use your own dropdown - Just for example', 'example'); Dropdown::show( getItemTypeForTable($options['searchoption']['table']), ['value' => $options['value'], @@ -376,14 +371,14 @@ function plugin_pre_item_update_example($item) } $item->input['comment'] .= addslashes("\nUpdate: ".date('r')); */ - Session::addMessageAfterRedirect(__('Pre Update Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Pre Update Computer Hook', 'example'), true); } // Hook done on update item case function plugin_item_update_example($item) { - Session::addMessageAfterRedirect(sprintf(__('Update Computer Hook (%s)', 'example'), implode(',', $item->updates)), true); + Session::addMessageAfterRedirect(sprintf(__s('Update Computer Hook (%s)', 'example'), implode(',', $item->updates)), true); return true; } @@ -393,7 +388,7 @@ function plugin_item_update_example($item) function plugin_item_empty_example($item) { if (empty($_SESSION['Already displayed "Empty Computer Hook"'])) { - Session::addMessageAfterRedirect(__('Empty Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Empty Computer Hook', 'example'), true); $_SESSION['Already displayed "Empty Computer Hook"'] = true; } @@ -405,14 +400,14 @@ function plugin_item_empty_example($item) function plugin_pre_item_delete_example($object) { // Manipulate data if needed - Session::addMessageAfterRedirect(__('Pre Delete Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Pre Delete Computer Hook', 'example'), true); } // Hook done on delete item case function plugin_item_delete_example($object) { - Session::addMessageAfterRedirect(__('Delete Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Delete Computer Hook', 'example'), true); return true; } @@ -422,14 +417,14 @@ function plugin_item_delete_example($object) function plugin_pre_item_purge_example($object) { // Manipulate data if needed - Session::addMessageAfterRedirect(__('Pre Purge Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Pre Purge Computer Hook', 'example'), true); } // Hook done on purge item case function plugin_item_purge_example($object) { - Session::addMessageAfterRedirect(__('Purge Computer Hook', 'example'), true); + Session::addMessageAfterRedirect(__s('Purge Computer Hook', 'example'), true); return true; } @@ -439,7 +434,7 @@ function plugin_item_purge_example($object) function plugin_pre_item_restore_example($item) { // Manipulate data if needed - Session::addMessageAfterRedirect(__('Pre Restore Computer Hook', 'example')); + Session::addMessageAfterRedirect(__s('Pre Restore Computer Hook', 'example')); } @@ -447,14 +442,14 @@ function plugin_pre_item_restore_example($item) function plugin_pre_item_restore_example2($item) { // Manipulate data if needed - Session::addMessageAfterRedirect(__('Pre Restore Phone Hook', 'example')); + Session::addMessageAfterRedirect(__s('Pre Restore Phone Hook', 'example')); } // Hook done on restore item case function plugin_item_restore_example($item) { - Session::addMessageAfterRedirect(__('Restore Computer Hook', 'example')); + Session::addMessageAfterRedirect(__s('Restore Computer Hook', 'example')); return true; } @@ -465,7 +460,7 @@ function plugin_item_transfer_example($parm) { //TRANS: %1$s is the source type, %2$d is the source ID, %3$d is the destination ID Session::addMessageAfterRedirect(sprintf( - __('Transfer Computer Hook %1$s %2$d -> %3$d', 'example'), + __s('Transfer Computer Hook %1$s %2$d -> %3$d', 'example'), $parm['type'], $parm['id'], $parm['newID'], @@ -676,13 +671,13 @@ function plugin_example_AssignToTicket($types) function plugin_example_get_events(NotificationTargetTicket $target) { - $target->events['plugin_example'] = __('Example event', 'example'); + $target->events['plugin_example'] = __s('Example event', 'example'); } function plugin_example_get_datas(NotificationTargetTicket $target) { - $target->data['##ticket.example##'] = __('Example datas', 'example'); + $target->data['##ticket.example##'] = __s('Example datas', 'example'); } @@ -745,7 +740,7 @@ function plugin_example_display_central() { echo ""; echo "
"; - echo __('Plugin example displays on central page', 'example'); + echo __s('Plugin example displays on central page', 'example'); echo '
'; echo ''; } @@ -753,21 +748,20 @@ function plugin_example_display_central() function plugin_example_display_login() { echo "
"; - echo __('Plugin example displays on login page', 'example'); + echo __s('Plugin example displays on login page', 'example'); echo '
'; } function plugin_example_infocom_hook($params) { echo ""; - echo __('Plugin example displays on central page', 'example'); + echo __s('Plugin example displays on central page', 'example'); echo ''; } function plugin_example_filter_actors(array $params = []): array { $itemtype = $params['params']['itemtype']; - $items_id = $params['params']['items_id']; // remove users_id = 1 for assignee list if ($itemtype == 'Ticket' && $params['params']['actortype'] == 'assign') { diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..7958e23 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..5b24fa4 --- /dev/null +++ b/rector.php @@ -0,0 +1,97 @@ +. + * ------------------------------------------------------------------------- + * @copyright Copyright (C) 2006-2022 by Example plugin team. + * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html + * @link https://github.com/pluginsGLPI/example + * ------------------------------------------------------------------------- + */ + +require_once __DIR__ . '/../../src/Plugin.php'; + +use Rector\Caching\ValueObject\Storage\FileCacheStorage; +use Rector\CodeQuality\Rector as CodeQuality; +use Rector\Config\RectorConfig; +use Rector\DeadCode\Rector as DeadCode; +use Rector\ValueObject\PhpVersion; + +return RectorConfig::configure() + ->withPaths([ + __DIR__ . '/front', + __DIR__ . '/src', + ]) + ->withPhpVersion(PhpVersion::PHP_82) + ->withCache( + cacheClass: FileCacheStorage::class, + cacheDirectory: sys_get_temp_dir() . '/example-rector', + ) + ->withRootFiles() + ->withParallel(timeoutSeconds: 300) + ->withImportNames(removeUnusedImports: true) + ->withRules([ + CodeQuality\Assign\CombinedAssignRector::class, + CodeQuality\BooleanAnd\RemoveUselessIsObjectCheckRector::class, + CodeQuality\BooleanAnd\SimplifyEmptyArrayCheckRector::class, + CodeQuality\BooleanNot\ReplaceMultipleBooleanNotRector::class, + CodeQuality\Catch_\ThrowWithPreviousExceptionRector::class, + CodeQuality\Empty_\SimplifyEmptyCheckOnEmptyArrayRector::class, + CodeQuality\Expression\InlineIfToExplicitIfRector::class, + CodeQuality\Expression\TernaryFalseExpressionToIfRector::class, + CodeQuality\For_\ForRepeatedCountToOwnVariableRector::class, + CodeQuality\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class, + CodeQuality\Foreach_\ForeachToInArrayRector::class, + CodeQuality\Foreach_\SimplifyForeachToCoalescingRector::class, + CodeQuality\Foreach_\UnusedForeachValueToArrayKeysRector::class, + CodeQuality\FuncCall\ChangeArrayPushToArrayAssignRector::class, + CodeQuality\FuncCall\CompactToVariablesRector::class, + CodeQuality\FuncCall\InlineIsAInstanceOfRector::class, + CodeQuality\FuncCall\IsAWithStringWithThirdArgumentRector::class, + CodeQuality\FuncCall\RemoveSoleValueSprintfRector::class, + CodeQuality\FuncCall\SetTypeToCastRector::class, + CodeQuality\FuncCall\SimplifyFuncGetArgsCountRector::class, + CodeQuality\FuncCall\SimplifyInArrayValuesRector::class, + CodeQuality\FuncCall\SimplifyStrposLowerRector::class, + CodeQuality\FuncCall\UnwrapSprintfOneArgumentRector::class, + CodeQuality\Identical\BooleanNotIdenticalToNotIdenticalRector::class, + CodeQuality\Identical\SimplifyArraySearchRector::class, + CodeQuality\Identical\SimplifyConditionsRector::class, + CodeQuality\Identical\StrlenZeroToIdenticalEmptyStringRector::class, + CodeQuality\If_\CombineIfRector::class, + CodeQuality\If_\CompleteMissingIfElseBracketRector::class, + CodeQuality\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class, + CodeQuality\If_\ExplicitBoolCompareRector::class, + CodeQuality\If_\ShortenElseIfRector::class, + CodeQuality\If_\SimplifyIfElseToTernaryRector::class, + CodeQuality\If_\SimplifyIfNotNullReturnRector::class, + CodeQuality\If_\SimplifyIfNullableReturnRector::class, + CodeQuality\If_\SimplifyIfReturnBoolRector::class, + CodeQuality\Include_\AbsolutizeRequireAndIncludePathRector::class, + CodeQuality\LogicalAnd\AndAssignsToSeparateLinesRector::class, + CodeQuality\LogicalAnd\LogicalToBooleanRector::class, + CodeQuality\NotEqual\CommonNotEqualRector::class, + CodeQuality\Ternary\UnnecessaryTernaryExpressionRector::class, + DeadCode\Assign\RemoveUnusedVariableAssignRector::class, + ]) + ->withPhpSets(php74: true) // apply PHP sets up to PHP 7.4 +; diff --git a/setup.php b/setup.php index 5342585..7a24a49 100644 --- a/setup.php +++ b/setup.php @@ -27,15 +27,15 @@ * @link https://github.com/pluginsGLPI/example * ------------------------------------------------------------------------- */ - use Glpi\Plugin\Hooks; use GlpiPlugin\Example\Computer; use GlpiPlugin\Example\Config; -use GlpiPlugin\Example\Dropdown; use GlpiPlugin\Example\DeviceCamera; +use GlpiPlugin\Example\Dropdown; use GlpiPlugin\Example\Example; use GlpiPlugin\Example\Filters\ComputerModelFilter; use GlpiPlugin\Example\ItemForm; +use GlpiPlugin\Example\Profile; use GlpiPlugin\Example\RuleTestCollection; use GlpiPlugin\Example\Showtabitem; @@ -86,13 +86,11 @@ function plugin_init_example() ['device_types' => true], ); - if (version_compare(GLPI_VERSION, '9.1', 'ge')) { - if (class_exists(Example::class)) { - Link::registerTag(Example::$tags); - } + if (version_compare(GLPI_VERSION, '9.1', 'ge') && class_exists(Example::class)) { + Link::registerTag(Example::$tags); } // Display a menu entry ? - Plugin::registerClass(\GlpiPlugin\Example\Profile::class, ['addtabon' => ['Profile']]); + Plugin::registerClass(Profile::class, ['addtabon' => ['Profile']]); if (Example::canView()) { // Right set in change_profile hook $PLUGIN_HOOKS['menu_toadd']['example'] = ['plugins' => Example::class, 'tools' => Example::class]; @@ -328,10 +326,7 @@ function plugin_version_example() */ function plugin_example_check_prerequisites() { - if (false) { - return false; - } - return true; + return !false; } /** @@ -348,7 +343,7 @@ function plugin_example_check_config($verbose = false) } if ($verbose) { - echo __('Installed / not configured', 'example'); + echo __s('Installed / not configured', 'example'); } return false; } diff --git a/src/Computer.php b/src/Computer.php index cae1dab..efe4e63 100644 --- a/src/Computer.php +++ b/src/Computer.php @@ -43,11 +43,11 @@ public static function showInfo() { echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' . __('More information') . '' . __s('More information') . '
'; - echo __('Test successful'); + echo __s('Test successful'); echo '
'; @@ -65,7 +65,7 @@ public static function item_can($item) public static function add_default_where($in) { - list($itemtype, $condition) = $in; + [$itemtype, $condition] = $in; if ($itemtype == 'Computer') { $table = getTableForItemType($itemtype); $condition .= ' (' . $table . '.groups_id NOT IN (' . implode(',', $_SESSION['glpigroups']) . '))'; diff --git a/src/Config.php b/src/Config.php index c6804d7..9f1f602 100644 --- a/src/Config.php +++ b/src/Config.php @@ -44,10 +44,8 @@ class Config extends CommonDBTM public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if (!$withtemplate) { - if ($item->getType() == 'Config') { - return __('Example plugin'); - } + if (!$withtemplate && $item->getType() == 'Config') { + return __s('Example plugin'); } return ''; @@ -73,10 +71,10 @@ public function showFormExample() echo "
"; echo "
"; echo ""; - echo "'; - echo ''; + echo "'; + echo ''; echo "'; diff --git a/src/DeviceCamera.php b/src/DeviceCamera.php index c71c7a9..8fdb024 100644 --- a/src/DeviceCamera.php +++ b/src/DeviceCamera.php @@ -42,6 +42,6 @@ class DeviceCamera extends CommonDevice { public static function getTypeName($nb = 0) { - return _n('Camera', 'Cameras', $nb); + return _sn('Camera', 'Cameras', $nb); } } diff --git a/src/Document.php b/src/Document.php index 8fe331d..fc81200 100644 --- a/src/Document.php +++ b/src/Document.php @@ -58,9 +58,6 @@ namespace GlpiPlugin\Example; use Document as GlpiDocument; -use Exception; -use Glpi\Exception\Http\NotFoundHttpException; -use Sabre\DAV\Exception\BadRequest; class Document extends GlpiDocument { @@ -74,9 +71,9 @@ class Document extends GlpiDocument public static function getTable($classname = null) { if ($classname === null) { - $classname = get_called_class(); + $classname = static::class; } - if ($classname == get_called_class()) { + if ($classname == static::class) { return parent::getTable(Document::class); } @@ -128,11 +125,9 @@ public function prepareInputForUpdate($input) public function post_getFromDB() { // Check the user can view this itemtype and can view this item - if ($this->canView() && $this->canViewItem()) { - if (isset($_SERVER['HTTP_ACCEPT']) && $_SERVER['HTTP_ACCEPT'] == 'application/octet-stream' - || isset($_GET['alt']) && $_GET['alt'] == 'media') { - $this->sendFile(); // and terminate script - } + if ($this->canView() && $this->canViewItem() && (isset($_SERVER['HTTP_ACCEPT']) && $_SERVER['HTTP_ACCEPT'] == 'application/octet-stream' || isset($_GET['alt']) && $_GET['alt'] == 'media')) { + $this->sendFile(); + // and terminate script } } @@ -167,14 +162,12 @@ protected function sendFile() } // set range if specified by the client - if (isset($_SERVER['HTTP_RANGE'])) { - if (preg_match('/bytes=\h*(\d+)?-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) { - if (!empty($matches[1])) { - $begin = intval($matches[1]); - } - if (!empty($matches[2])) { - $end = min(intval($matches[2]), $end); - } + if (isset($_SERVER['HTTP_RANGE']) && preg_match('/bytes=\h*(\d+)?-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) { + if (!empty($matches[1])) { + $begin = intval($matches[1]); + } + if (!empty($matches[2])) { + $end = min(intval($matches[2]), $end); } } diff --git a/src/Dropdown.php b/src/Dropdown.php index c3f29ea..468796b 100644 --- a/src/Dropdown.php +++ b/src/Dropdown.php @@ -43,9 +43,9 @@ class Dropdown extends CommonDropdown public static function getTypeName($nb = 0) { if ($nb > 0) { - return __('Plugin Example Dropdowns', 'example'); + return __s('Plugin Example Dropdowns', 'example'); } - return __('Plugin Example Dropdowns', 'example'); + return __s('Plugin Example Dropdowns', 'example'); } } diff --git a/src/Example.php b/src/Example.php index 35a1b7c..6d40169 100644 --- a/src/Example.php +++ b/src/Example.php @@ -39,7 +39,6 @@ use CommonDBTM; use CommonGLPI; use Computer; -use DBmysql; use Html; use Item_Disk; use Log; @@ -64,7 +63,7 @@ public static function getTypeName($nb = 0) public static function getMenuName() { - return __('Example plugin'); + return __s('Example plugin'); } public static function getAdditionalMenuLinks() @@ -97,7 +96,7 @@ public function showForm($ID, array $options = []) echo ""; - echo ''; + echo ''; echo ''; @@ -113,28 +112,28 @@ public function rawSearchOptions() $tab[] = [ 'id' => 'common', - 'name' => __('Header Needed'), + 'name' => __s('Header Needed'), ]; $tab[] = [ 'id' => '1', 'table' => 'glpi_plugin_example_examples', 'field' => 'name', - 'name' => __('Name'), + 'name' => __s('Name'), ]; $tab[] = [ 'id' => '2', 'table' => 'glpi_plugin_example_dropdowns', 'field' => 'name', - 'name' => __('Dropdown'), + 'name' => __s('Dropdown'), ]; $tab[] = [ 'id' => '3', 'table' => 'glpi_plugin_example_examples', 'field' => 'serial', - 'name' => __('Serial number'), + 'name' => __s('Serial number'), 'usehaving' => true, 'searchtype' => 'equals', ]; @@ -143,7 +142,7 @@ public function rawSearchOptions() 'id' => '30', 'table' => 'glpi_plugin_example_examples', 'field' => 'id', - 'name' => __('ID'), + 'name' => __s('ID'), 'usehaving' => true, 'searchtype' => 'equals', ]; @@ -162,8 +161,8 @@ public static function cronInfo($name) { switch ($name) { case 'Sample': - return ['description' => __('Cron description for example', 'example'), - 'parameter' => __('Cron parameter for example', 'example')]; + return ['description' => __s('Cron description for example', 'example'), + 'parameter' => __s('Cron parameter for example', 'example')]; } return []; @@ -220,23 +219,23 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) if (!$withtemplate) { if ($item instanceof Profile) { if ($item->getField('central')) { - return __('Example', 'example'); + return __s('Example', 'example'); } } elseif ($item instanceof Phone) { if ($_SESSION['glpishow_count_on_tabs']) { return self::createTabEntry( - __('Example', 'example'), + __s('Example', 'example'), countElementsInTable($this->getTable()), ); } - return __('Example', 'example'); + return __s('Example', 'example'); } elseif ($item instanceof Item_Disk || $item instanceof Supplier) { return [ - 1 => __('Test Plugin', 'example'), - 2 => __('Test Plugin 2', 'example'), + 1 => __s('Test Plugin', 'example'), + 2 => __s('Test Plugin 2', 'example'), ]; } elseif ($item instanceof Computer @@ -244,7 +243,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) || $item instanceof Preference || $item instanceof Notification) { return [ - 1 => __('Test Plugin', 'example'), + 1 => __s('Test Plugin', 'example'), ]; } } @@ -255,10 +254,10 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { if ($item instanceof Phone) { - echo __('Plugin Example on Phone', 'example'); + echo __s('Plugin Example on Phone', 'example'); } elseif ($item instanceof Central) { - echo __('Plugin central action', 'example'); + echo __s('Plugin central action', 'example'); } elseif ($item instanceof Preference) { // Complete form display @@ -279,18 +278,18 @@ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $ echo ''; } elseif ($item instanceof Notification) { - echo __('Plugin mailing action', 'example'); + echo __s('Plugin mailing action', 'example'); } elseif ($item instanceof Item_Disk || $item instanceof Supplier) { if ($tabnum == 1) { - echo __('First tab of Plugin example', 'example'); + echo __s('First tab of Plugin example', 'example'); } else { - echo __('Second tab of Plugin example', 'example'); + echo __s('Second tab of Plugin example', 'example'); } } else { //TRANS: %1$s is a class name, %2$d is an item ID - printf(__('Plugin example CLASS=%1$s', 'example'), get_class($item)); + printf(__s('Plugin example CLASS=%1$s', 'example'), get_class($item)); } @@ -321,7 +320,7 @@ public static function populatePlanning($parm) $key = $parm['begin'] . '$$$' . 'plugin_example1'; $output[$key]['begin'] = date('Y-m-d 17:00:00'); $output[$key]['end'] = date('Y-m-d 18:00:00'); - $output[$key]['name'] = __('test planning example 1', 'example'); + $output[$key]['name'] = __s('test planning example 1', 'example'); // Specify the itemtype to be able to use specific display system $output[$key]['itemtype'] = Example::class; // Set the ID using the ID of the item in the database to have unique ID @@ -348,7 +347,7 @@ public static function displayPlanningItem(array $val, $who, $type = '', $comple case 'in': //TRANS: %1$s is the start time of a planned item, %2$s is the end printf( - __('From %1$s to %2$s :'), + __s('From %1$s to %2$s :'), date('H:i', strtotime($val['begin'])), date('H:i', strtotime($val['end'])), ); @@ -360,12 +359,12 @@ public static function displayPlanningItem(array $val, $who, $type = '', $comple case 'begin': //TRANS: %s is the start time of a planned item - printf(__('Start at %s:'), date('H:i', strtotime($val['begin']))); + printf(__s('Start at %s:'), date('H:i', strtotime($val['begin']))); break; case 'end': //TRANS: %s is the end time of a planned item - printf(__('End at %s:'), date('H:i', strtotime($val['end']))); + printf(__s('End at %s:'), date('H:i', strtotime($val['end']))); break; } echo '
'; @@ -385,7 +384,7 @@ public static function getHistoryEntry($data) { switch ($data['linked_action'] - Log::HISTORY_PLUGIN) { case 0: - return __('History from plugin example', 'example'); + return __s('History from plugin example', 'example'); } return ''; @@ -398,7 +397,7 @@ public function getSpecificMassiveActions($checkitem = null) $actions = parent::getSpecificMassiveActions($checkitem); $actions['Document_Item' . MassiveAction::CLASS_ACTION_SEPARATOR . 'add'] = _x('button', 'Add a document'); // GLPI core one - $actions[__CLASS__ . MassiveAction::CLASS_ACTION_SEPARATOR . 'do_nothing'] = __('Do Nothing - just for fun', 'example'); // Specific one + $actions[self::class . MassiveAction::CLASS_ACTION_SEPARATOR . 'do_nothing'] = __s('Do Nothing - just for fun', 'example'); // Specific one return $actions; } @@ -409,12 +408,12 @@ public static function showMassiveActionsSubForm(MassiveAction $ma) case 'DoIt': echo " " . Html::submit(_x('button', 'Post'), ['name' => 'massiveaction']) . - ' ' . __('Write in item history', 'example'); + ' ' . __s('Write in item history', 'example'); return true; case 'do_nothing': echo ' ' . Html::submit(_x('button', 'Post'), ['name' => 'massiveaction']) . - ' ' . __('but do nothing :)', 'example'); + ' ' . __s('but do nothing :)', 'example'); return true; } @@ -437,8 +436,8 @@ public static function processMassiveActionsForOneItemtype( switch ($ma->getAction()) { case 'DoIt': if ($item->getType() == 'Computer') { - Session::addMessageAfterRedirect(__('Right it is the type I want...', 'example')); - Session::addMessageAfterRedirect(__('Write in item history', 'example')); + Session::addMessageAfterRedirect(__s('Right it is the type I want...', 'example')); + Session::addMessageAfterRedirect(__s('Write in item history', 'example')); $changes = [0, 'old value', 'new value']; foreach ($ids as $id) { if ($item->getFromDB($id)) { @@ -465,8 +464,8 @@ public static function processMassiveActionsForOneItemtype( case 'do_nothing': if ($item->getType() == Example::class) { - Session::addMessageAfterRedirect(__('Right it is the type I want...', 'example')); - Session::addMessageAfterRedirect(__( + Session::addMessageAfterRedirect(__s('Right it is the type I want...', 'example')); + Session::addMessageAfterRedirect(__s( 'But... I say I will do nothing for:', 'example', )); @@ -503,12 +502,12 @@ public static function dashboardTypes() { return [ 'example' => [ - 'label' => __('Plugin Example', 'example'), + 'label' => __s('Plugin Example', 'example'), 'function' => Example::class . '::cardWidget', 'image' => 'https://via.placeholder.com/100x86?text=example', ], 'example_static' => [ - 'label' => __('Plugin Example (static)', 'example'), + 'label' => __s('Plugin Example (static)', 'example'), 'function' => Example::class . '::cardWidgetWithoutProvider', 'image' => 'https://via.placeholder.com/100x86?text=example+static', ], @@ -523,16 +522,16 @@ public static function dashboardCards($cards = []) $new_cards = [ 'plugin_example_card' => [ 'widgettype' => ['example'], - 'label' => __('Plugin Example card'), + 'label' => __s('Plugin Example card'), 'provider' => Example::class . '::cardDataProvider', ], 'plugin_example_card_without_provider' => [ 'widgettype' => ['example_static'], - 'label' => __('Plugin Example card without provider'), + 'label' => __s('Plugin Example card without provider'), ], 'plugin_example_card_with_core_widget' => [ 'widgettype' => ['bigNumber'], - 'label' => __('Plugin Example card with core provider'), + 'label' => __s('Plugin Example card with core provider'), 'provider' => Example::class . '::cardBigNumberProvider', ], ]; @@ -610,10 +609,9 @@ public static function cardBigNumberProvider(array $params = []) 'label' => null, 'icon' => null, ]; - $params = array_merge($default_params, $params); return [ - 'number' => rand(), + 'number' => random_int(0, mt_getrandmax()), 'url' => 'https://www.linux.org/', 'label' => 'plugin example - some text', 'icon' => 'fab fa-linux', // font awesome icon diff --git a/src/Filters/ComputerModelFilter.php b/src/Filters/ComputerModelFilter.php index 1cb4541..a258023 100644 --- a/src/Filters/ComputerModelFilter.php +++ b/src/Filters/ComputerModelFilter.php @@ -38,7 +38,7 @@ class ComputerModelFilter extends AbstractFilter { public static function getName(): string { - return __('Computer model'); + return __s('Computer model'); } public static function getId(): string diff --git a/src/ItemForm.php b/src/ItemForm.php index d1ba3c3..2aaafaa 100644 --- a/src/ItemForm.php +++ b/src/ItemForm.php @@ -50,9 +50,6 @@ class ItemForm */ public static function preSection($params) { - $item = $params['item']; - $options = $params['options']; - echo TemplateRenderer::getInstance()->renderFromStringTemplate(<<

@@ -81,9 +78,6 @@ public static function preSection($params) */ public static function postSection($params) { - $item = $params['item']; - $options = $params['options']; - echo TemplateRenderer::getInstance()->renderFromStringTemplate(<<

@@ -119,25 +113,25 @@ public static function preItemForm($params) $out = '

'; $out .= "<$firstelt>"; - $out .= ''; + $out .= ''; $out .= "<$firstelt>"; - $out .= ''; + $out .= ''; $out .= "'; $out .= ''; $out .= "<$firstelt>"; - $out .= ''; + $out .= ''; $out .= "<$firstelt>"; - $out .= ''; + $out .= ''; $out .= "'; $out .= '
" . __('Example setup') . '
' . __('My boolean choice :') . '
" . __s('Example setup') . '
' . __s('My boolean choice :') . '"; - echo ""; + echo ""; echo ""; Dropdown::showYesNo('configuration', $my_config['configuration']); echo '
' . __('ID') . '' . __s('ID') . ''; echo $ID; echo '
'; $out .= sprintf( - __('Start %1$s hook call for %2$s type'), + __s('Start %1$s hook call for %2$s type'), 'pre_item_form', $item::getType(), ); $out .= '
"; $out .= ''; $out .= ""; $out .= ''; $out .= '
'; $out .= sprintf( - __('End %1$s hook call for %2$s type'), + __s('End %1$s hook call for %2$s type'), 'pre_item_form', $item::getType(), ); @@ -162,25 +156,25 @@ public static function postItemForm($params) $out = '
'; $out .= sprintf( - __('Start %1$s hook call for %2$s type'), + __s('Start %1$s hook call for %2$s type'), 'post_item_form', $item::getType(), ); $out .= '
"; $out .= ''; $out .= ""; $out .= ''; $out .= '
'; $out .= sprintf( - __('End %1$s hook call for %2$s type'), + __s('End %1$s hook call for %2$s type'), 'post_item_form', $item::getType(), ); @@ -209,7 +203,7 @@ public static function timelineActions($params = []) echo "
  • " . - __('Send a notification') . + __s('Send a notification') . Html::scriptBlock($JS) . '
  • '; } diff --git a/src/NotificationTargetExample.php b/src/NotificationTargetExample.php index d4bc300..2ed5d0f 100644 --- a/src/NotificationTargetExample.php +++ b/src/NotificationTargetExample.php @@ -42,6 +42,6 @@ public function getEvents() public function addDataForTemplate($event, $options = []) { - $this->data['##example.name##'] = __('Example', 'example'); + $this->data['##example.name##'] = __s('Example', 'example'); } } diff --git a/src/Profile.php b/src/Profile.php index 0ceeb92..404fddc 100644 --- a/src/Profile.php +++ b/src/Profile.php @@ -42,7 +42,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) $item instanceof \Profile && $item->getField('id') ) { - return self::createTabEntry(__('Example plugin')); + return self::createTabEntry(__s('Example plugin')); } return ''; diff --git a/src/RuleTest.php b/src/RuleTest.php index ca2dead..09eb7e9 100644 --- a/src/RuleTest.php +++ b/src/RuleTest.php @@ -64,7 +64,7 @@ public function getCriterias() { $criterias = []; $criterias['name']['field'] = 'name'; - $criterias['name']['name'] = __('Software'); + $criterias['name']['name'] = __s('Software'); $criterias['name']['table'] = 'glpi_softwares'; return $criterias; @@ -73,7 +73,7 @@ public function getCriterias() public function getActions() { $actions = []; - $actions['softwarecategories_id']['name'] = __('Category (class)', 'example'); + $actions['softwarecategories_id']['name'] = __s('Category (class)', 'example'); $actions['softwarecategories_id']['type'] = 'dropdown'; $actions['softwarecategories_id']['table'] = 'glpi_softwarecategories'; diff --git a/src/Showtabitem.php b/src/Showtabitem.php index 89469fb..74834f4 100644 --- a/src/Showtabitem.php +++ b/src/Showtabitem.php @@ -68,14 +68,15 @@ public static function pre_show_tab($params) { switch ($params['item']->getType()) { case 'Ticket': - if ($params['options']['itemtype'] == 'TicketValidation' && $params['options']['tabnum'] == 2) { - // if tasks are not all done - // then prevent solution div to show - // this is an example to prevent solving of ticket - if (true) { // here you should test if some tasks are in todo status. - $params['options']['prevent_solution'] = true; // this will be passed to the post_show hook - echo "