diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..5fd203d --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,20 @@ +in(__DIR__) + ->name('*.php'); + +$config = new Config(); + +$rules = [ + '@PER-CS2.0' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays']], // For PHP 7.4 compatibility +]; + +return $config + ->setRules($rules) + ->setFinder($finder) + ->setUsingCache(false); diff --git a/composer.json b/composer.json index 4bcb85b..60c63f1 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,10 @@ "php": ">=7.4" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.64", "glpi-project/tools": "^0.7.3", "php-parallel-lint/php-parallel-lint": "^1.4", - "phpstan/phpstan": "^1.12", - "squizlabs/php_codesniffer": "^3.10" + "phpstan/phpstan": "^1.12" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index eef3722..4c32cee 100644 --- a/composer.lock +++ b/composer.lock @@ -4,205 +4,1714 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74ed2cdb044b2436e95cc0760aeaedd2", + "content-hash": "be120f9e866d137931dc59d253a306ae", "packages": [], "packages-dev": [ { - "name": "glpi-project/tools", - "version": "0.7.3", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "a076482b057a727a9dcf155af40dac6c26a7b7c6" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/a076482b057a727a9dcf155af40dac6c26a7b7c6", - "reference": "a076482b057a727a9dcf155af40dac6c26a7b7c6", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "symfony/console": "^5.4 || ^6.0", - "twig/twig": "^3.3" + "php": ">=5.3", + "react/stream": "^1.2" }, "require-dev": { - "nikic/php-parser": "^4.13", - "phpstan/phpstan-src": "^1.10" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, - "bin": [ - "bin/extract-locales", - "bin/licence-headers-check", - "tools/plugin-release" - ], "type": "library", "autoload": { "psr-4": { - "GlpiProject\\Tools\\": "src/" + "Clue\\React\\NDJson\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "http://teclib-group.com" + "name": "Christian Lück", + "email": "christian@clue.engineering" } ], - "description": "Various tools for GLPI and its plugins", + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", "keywords": [ - "glpi", - "plugins", - "tools" + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" ], "support": { - "issues": "https://github.com/glpi-project/tools/issues", - "source": "https://github.com/glpi-project/tools" + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" }, - "time": "2024-06-20T08:36:22+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.4.0", + "name": "composer/pcre", + "version": "3.3.1", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + "url": "https://github.com/composer/pcre.git", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", "shasum": "" }, "require": { - "ext-json": "*", - "php": ">=5.3.0" + "php": "^7.4 || ^8.0" }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" + "conflict": { + "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", - "squizlabs/php_codesniffer": "^3.6" + "phpstan/phpstan": "^1.11.10", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8 || ^9" }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } }, - "bin": [ - "parallel-lint" + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.1" + }, + "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-08-27T18:44:43+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { - "classmap": [ - "./src/" - ] + "psr-4": { + "Composer\\Semver\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" + "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": "This tool checks the syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "lint", - "static analysis" + "semantic", + "semver", + "validation", + "versioning" ], "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" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.2" }, - "time": "2024-03-27T12:14:49+00:00" + "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-07-12T11:35:52+00:00" }, { - "name": "phpstan/phpstan", - "version": "1.12.0", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "384af967d35b2162f69526c7276acadce534d0e1" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", - "reference": "384af967d35b2162f69526c7276acadce534d0e1", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, - "conflict": { - "phpstan/phpstan-shim": "*" + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, - "bin": [ - "phpstan", - "phpstan.phar" - ], "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ] + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", "keywords": [ - "dev", - "static analysis" + "Xdebug", + "performance" ], "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" + "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" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" + "url": "https://packagist.com", + "type": "custom" }, { - "url": "https://github.com/phpstan", + "url": "https://github.com/composer", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "time": "2024-08-27T09:18:05+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" }, "type": "library", "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "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.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "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.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.64.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "58dd9c931c785a79739310aef5178928305ffa67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.0", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.3", + "infection/infection": "^0.29.5", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "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.64.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-08-30T23:09:38+00:00" + }, + { + "name": "glpi-project/tools", + "version": "0.7.3", + "source": { + "type": "git", + "url": "https://github.com/glpi-project/tools.git", + "reference": "a076482b057a727a9dcf155af40dac6c26a7b7c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/glpi-project/tools/zipball/a076482b057a727a9dcf155af40dac6c26a7b7c6", + "reference": "a076482b057a727a9dcf155af40dac6c26a7b7c6", + "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": "2024-06-20T08:36:22+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": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "384af967d35b2162f69526c7276acadce534d0e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", + "reference": "384af967d35b2162f69526c7276acadce534d0e1", + "shasum": "" + }, + "require": { + "php": "^7.2|^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": "2024-08-27T09:18:05+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "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/1.1.2" + }, + "time": "2021-11-05T16:50:12+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": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "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/1.1.4" + }, + "time": "2021-05-03T11:20:27+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.5", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "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.5" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-09-16T13:41:56+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.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 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.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+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": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^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" + }, + "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" + }, + "provide": { + "psr/log-implementation": "1.0|2.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": "" + }, + "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/v5.4.41" + }, + "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-06-28T07:48:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "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/v2.5.3" + }, + "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": "2023-01-24T14:02:46+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.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": "" + }, + "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/v5.4.40" + }, + "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-05-31T14:33:22+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/540f4c73e87fd0c71ca44a6aa305d024ac68cb73", + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -211,158 +1720,133 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.3" }, - "time": "2021-11-05T16:50:12+00:00" + "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-01-23T13:51:25+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.10.2", + "name": "symfony/filesystem", + "version": "v5.4.41", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + "url": "https://github.com/symfony/filesystem.git", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "symfony/process": "^5.4|^6.4" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "url": "https://github.com/jrfnl", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2024-07-21T23:26:44+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { - "name": "symfony/console", - "version": "v5.4.41", + "name": "symfony/finder", + "version": "v5.4.43", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + "url": "https://github.com/symfony/finder.git", + "reference": "ae25a9145a900764158d439653d5630191155ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^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" - }, - "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" - }, - "provide": { - "psr/log-implementation": "1.0|2.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": "" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -382,16 +1866,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.41" + "source": "https://github.com/symfony/finder/tree/v5.4.43" }, "funding": [ { @@ -407,38 +1885,35 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:48:55+00:00" + "time": "2024-08-13T14:03:51+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "name": "symfony/options-resolver", + "version": "v5.4.40", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/bd1afbde6613a8d6b956115e0e14b196191fd0c4", + "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { - "files": [ - "function.php" + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -447,18 +1922,23 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A generic function and convention to trigger deprecation notices", + "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/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.40" }, "funding": [ { @@ -474,7 +1954,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1026,6 +2506,68 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/process", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "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/v5.4.40" + }, + "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-05-31T14:33:22+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.5.3", @@ -1109,6 +2651,68 @@ ], "time": "2023-04-21T15:04:16+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0e9daf3b7c805c747638b2cc48f1649e594f9625", + "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^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/v5.4.40" + }, + "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-05-31T14:33:22+00:00" + }, { "name": "symfony/string", "version": "v5.4.41", diff --git a/front/config.form.php b/front/config.form.php index 64a8e1c..00332e8 100644 --- a/front/config.form.php +++ b/front/config.form.php @@ -32,16 +32,16 @@ $config = new PluginTreeviewConfig(); -if (isset($_POST["update"])) { +if (isset($_POST['update'])) { $config->update($_POST); Html::back(); } else { - if (Plugin::isPluginActive("treeview")) { - Html::header(PluginTreeviewConfig::getTypeName(), $_SERVER['PHP_SELF'], "config", "plugin"); + if (Plugin::isPluginActive('treeview')) { + Html::header(PluginTreeviewConfig::getTypeName(), $_SERVER['PHP_SELF'], 'config', 'plugin'); $config->showForm(1); } else { - Html::header(__('Setup'), $_SERVER['PHP_SELF'], "config", "plugin"); - // Get the configuration from the database and show it + Html::header(__('Setup'), $_SERVER['PHP_SELF'], 'config', 'plugin'); + // Get the configuration from the database and show it echo " "; } @@ -289,11 +289,10 @@ function plugin_treeview_reload($item) function plugin_change_entity_Treeview() { - if ( $_SESSION['glpiactiveprofile']['interface'] == 'central' - && (isset($_SESSION["glpi_plugin_treeview_loaded"]) - && $_SESSION["glpi_plugin_treeview_loaded"] == 1) + && (isset($_SESSION['glpi_plugin_treeview_loaded']) + && $_SESSION['glpi_plugin_treeview_loaded'] == 1) ) { echo ""; } diff --git a/inc/config.class.php b/inc/config.class.php index 0c783b0..dd575fc 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -58,109 +58,107 @@ class PluginTreeviewConfig extends CommonDBTM **/ public static function getTypeName($nb = 0) { - return __('Tree view', 'treeview'); } - /** - * Configuration form - **/ + /** + * Configuration form + **/ public function showForm($id, $options = []) { - $this->getFromDB($id); echo "
"; echo ""; - echo ""; + echo "'; - echo ""; + echo "'; echo ""; + echo "'; + echo "'; + echo ''; echo ""; - echo ""; + echo ''; echo ""; + echo "'; + echo "'; + echo ''; echo ""; - echo ""; + echo ''; echo ""; + echo "'; + echo "'; + echo ''; - echo ""; + echo "'; echo ""; - - echo ""; - echo "'; + + echo "'; + echo '"; + echo "'; + echo "'; + echo ''; echo ""; - echo ""; + echo "'; + echo "'; + echo ''; - echo ""; + echo "'; echo ""; + echo ''; + echo ''; - echo ""; - echo "'; + echo '"; + echo ''; + echo ''; echo ""; - echo "
" . __('Display', 'treeview') . "
" . __('Display', 'treeview') . '
" . __('Target for all the nodes', 'treeview') . "
" . __('Target for all the nodes', 'treeview') . '
" . __('Should folders be links', 'treeview') . "' . __('Should folders be links', 'treeview') . '
" . __('Nodes can be highlighted', 'treeview') . "' . __('Nodes can be highlighted', 'treeview') . '
" . __('Tree is drawn with lines', 'treeview') . "
" . __('Tree is drawn with lines', 'treeview') . '
" . __('Tree is drawn with icons', 'treeview') . ""; + echo "'; + echo "'; + echo '
" . __('Tree is drawn with icons', 'treeview') . ''; echo "
" . __('Only one node within a parent', 'treeview') . "
" . + echo '
' . __('Only one node within a parent', 'treeview') . '
' . __('can be expanded at the same time.', 'treeview'); - echo "
"; + echo ''; echo "
" . __('Item name', 'treeview') . "
" . __('Item name', 'treeview') . '
" . __('Location name', 'treeview') . ""; + echo "
" . __('Location name', 'treeview') . ''; echo "
"; echo ""; echo ""; - echo "
"; + echo ''; + echo ''; echo '"; + // Must be always the top window + echo ''; echo ""; - echo ""; - echo ""; - echo ""; - echo "<body>"; - echo "<p><a href='" . $CFG_GLPI['root_doc'] . "/front/central.php'>GLPI</a></p>"; - echo "</body>"; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ''; + echo '<body>'; + echo "<p><a href='" . $CFG_GLPI['root_doc'] . "/front/central.php'>GLPI</a></p>"; + echo '</body>'; + echo ''; + echo ''; + echo ''; } - - /** - * The function to hide the treeview - **/ + /** + * The function to hide the treeview + **/ public function hideTreeview() { echo ""; + echo 'if (top != self)'; + echo 'top.location = self.location;'; + echo ''; } - - /** - * The main function, build the javascript code of the treeview - **/ + /** + * The main function, build the javascript code of the treeview + **/ public function buildTreeview() { $treeview_url = Plugin::getWebDir('treeview'); - //necessary files needed for the tree to work. + //necessary files needed for the tree to work. echo ""; echo ""; echo "
"; echo ""; - echo "
"; + echo ''; + echo ''; } - - /** - * Requests the nodes from the GLPI database - **/ + /** + * Requests the nodes from the GLPI database + **/ public function getNodesFromDb() { /** @var DBmysql $DB */ global $DB; - // The tree object + // The tree object echo "var d = new dTree('d');\n"; echo "d.add(0,-1,'" . __('Tree view', 'treeview') . "');"; $config = new PluginTreeviewConfig(); - // Request the display settings from the database and store them in the global object $config + // Request the display settings from the database and store them in the global object $config $this->getFromDB(1); - $itemName = $this->fields["itemName"]; - $locationName = $this->fields["locationName"]; - $target = $this->fields["target"]; - $folderLinks = $this->fields["folderLinks"]; - $useSelection = $this->fields["useSelection"]; - $useLines = $this->fields["useLines"]; - $useIcons = $this->fields["useIcons"]; - $closeSameLevel = $this->fields["closeSameLevel"]; + $itemName = $this->fields['itemName']; + $locationName = $this->fields['locationName']; + $target = $this->fields['target']; + $folderLinks = $this->fields['folderLinks']; + $useSelection = $this->fields['useSelection']; + $useLines = $this->fields['useLines']; + $useIcons = $this->fields['useIcons']; + $closeSameLevel = $this->fields['closeSameLevel']; - // Load the settings in JavaSript so that dTree script can apply them + // Load the settings in JavaSript so that dTree script can apply them echo "d.config.target = '" . $target . "';\n"; - echo "d.config.folderLinks = " . $folderLinks . ";\n"; - echo "d.config.useSelection = " . $useSelection . ";\n"; - echo "d.config.useLines = " . $useLines . ";\n"; - echo "d.config.useIcons = " . $useIcons . ";\n"; - echo "d.config.closeSameLevel = " . $closeSameLevel . ";\n"; + echo 'd.config.folderLinks = ' . $folderLinks . ";\n"; + echo 'd.config.useSelection = ' . $useSelection . ";\n"; + echo 'd.config.useLines = ' . $useLines . ";\n"; + echo 'd.config.useIcons = ' . $useIcons . ";\n"; + echo 'd.config.closeSameLevel = ' . $closeSameLevel . ";\n"; $dontLoad = 'false'; - // Get the lowest level of the tree nodes and the highest primary key + // Get the lowest level of the tree nodes and the highest primary key $it = $DB->request([ 'SELECT' => [ new QueryExpression('MAX(' . $DB::quoteName('id') . ') AS ' . $DB::quoteName('max_id')), new QueryExpression('MAX(' . $DB::quoteName('level') . ') AS ' . $DB::quoteName('max_level')), ], - 'FROM' => 'glpi_locations', + 'FROM' => 'glpi_locations', 'WHERE' => getEntitiesRestrictCriteria('glpi_locations', '', '', true), ]); $result = $it->current(); @@ -336,75 +330,75 @@ public function getNodesFromDb() $tv_id = $max_id = $result['max_id']; $tv_id++; - // Is this the first time we load the page? - if (isset($_GET['nodes']) && $_GET['nodes'] != "") { + // Is this the first time we load the page? + if (isset($_GET['nodes']) && $_GET['nodes'] != '') { // If no then get all the nodes requested by the client $nodes = array_reverse(explode('.', $_GET['nodes'])); } else { - // If yes then get only the root node + // If yes then get only the root node $nodes[0] = 0; } - // If an item group is requested, then save its type to use it later in the openTo function - if (isset($_GET['openedType']) && $_GET['openedType'] != "") { + // If an item group is requested, then save its type to use it later in the openTo function + if (isset($_GET['openedType']) && $_GET['openedType'] != '') { $openedType = $_GET['openedType']; } else { $openedType = -1; } - // Characters which need to be removed from JS output. - $trans = ["\"" => "`", - "\r" => " ", - "\n" => " " + // Characters which need to be removed from JS output. + $trans = ['"' => '`', + "\r" => ' ', + "\n" => ' ', ]; $node_count = count($nodes); for ($n = 1; $n <= $node_count; $n++) { if ($nodes[$n - 1] <= $max_id && $n <= $max_level) { $it = $DB->request([ - 'FROM' => 'glpi_locations', + 'FROM' => 'glpi_locations', 'WHERE' => [ - 'level' => $n, + 'level' => $n, 'locations_id' => $nodes[$n - 1], ] + getEntitiesRestrictCriteria('glpi_locations', '', '', true), - 'ORDER' => ['completename ASC'] + 'ORDER' => ['completename ASC'], ]); foreach ($it as $r) { $l_name = ''; - // Location's name schema + // Location's name schema if ($locationName == 0) { $l_name = $r['name']; - } else if ($locationName == 1) { + } elseif ($locationName == 1) { $l_name = $r['completename']; - } else if ($locationName == 2) { + } elseif ($locationName == 2) { $l_name = $r['name']; - if ($r['comment'] != "") { + if ($r['comment'] != '') { $l_name .= ' (' . $r['comment'] . ')'; } - } else if ($locationName == 3) { + } elseif ($locationName == 3) { $l_name = $r['completename']; - if ($r['comment'] != "") { - $l_name .= ' (' . $r['comment'] . ')'; + if ($r['comment'] != '') { + $l_name .= ' (' . $r['comment'] . ')'; } } - // Is this location requested by the user to be opened + // Is this location requested by the user to be opened if (in_array($r['id'], $nodes)) { - echo "d.add(" . $r['id'] . ", " . $r['locations_id'] . ", \"" . strtr($l_name, $trans) . - "\", true, -1,'');\n"; - $dontLoad = 'true'; - // Then add aloso its items + echo 'd.add(' . $r['id'] . ', ' . $r['locations_id'] . ', "' . strtr($l_name, $trans) . + "\", true, -1,'');\n"; + $dontLoad = 'true'; + // Then add aloso its items foreach (self::$types as $type) { - $item = new $type(); - $itemtable = getTableForItemType($type); + $item = new $type(); + $itemtable = getTableForItemType($type); $criteria = [ - 'FROM' => $itemtable, + 'FROM' => $itemtable, 'WHERE' => [ 'locations_id' => $r['id'], ], - 'ORDER' => ["$itemtable.name"] + 'ORDER' => ["$itemtable.name"], ]; if ($item->maybeTemplate()) { @@ -415,39 +409,39 @@ public function getNodesFromDb() } if ($this->isEntityAssign()) { - $criteria['WHERE']['entities_id'] = $_SESSION["glpiactive_entity"]; + $criteria['WHERE']['entities_id'] = $_SESSION['glpiactive_entity']; } $result_1 = $DB->request($criteria); - $pid = 0; + $pid = 0; if (count($result_1)) { - $pid = $tv_id; + $pid = $tv_id; $field_num = 3; $result_location = $DB->request([ 'SELECT' => ['completename'], - 'FROM' => 'glpi_locations', - 'WHERE' => ['id' => $r['id']] + 'FROM' => 'glpi_locations', + 'WHERE' => ['id' => $r['id']], ]); foreach ($result_location as $row) { $name_location = $row['completename']; } - $value = $r['id']; - $token = Session::getNewCSRFToken(); + $value = $r['id']; + $token = Session::getNewCSRFToken(); $getParam = "?is_deleted=0&criteria[0][field]=$field_num&criteria[0][searchtype]=equals&criteria[0][value]=$value&search=Rechercher&start=0&_glpi_csrf_token=$token"; $searchUrl = Toolbox::getItemTypeSearchURL($type) . $getParam; - $params = ['itemtype' => $type, - 'locations_id' => $value, - 'searchurl' => $searchUrl + $params = ['itemtype' => $type, + 'locations_id' => $value, + 'searchurl' => $searchUrl, ]; $opt = Plugin::doHookFunction('treeview_search_url_parent_node', $params); - // Add items parent node - echo "d.add($tv_id," . $r['id'] . ",\"" . strtr($item::getTypeName(2), $trans) . + // Add items parent node + echo "d.add($tv_id," . $r['id'] . ',"' . strtr($item::getTypeName(2), $trans) . "\", $dontLoad, '" . $type . "', '" . $opt['searchurl'] . "', '', '', '" . $type::getIcon() . "', '" . $type::getIcon() . "');\n"; @@ -459,88 +453,87 @@ public function getNodesFromDb() foreach ($result_1 as $r_1) { $i_name = ''; - // Item's name schema + // Item's name schema if ($itemName == 0 || $type == 'Software') { $i_name = $r_1['name']; - } else if ($itemName == 1) { + } elseif ($itemName == 1) { if (isset($r_1['otherserial']) && !empty($r_1['otherserial'])) { $i_name = $r_1['otherserial']; } else { $i_name = $r_1['name']; } - } else if ($itemName == 2) { - $i_name = $r_1['name'] != "" ? $r_1['name'] : ""; + } elseif ($itemName == 2) { + $i_name = $r_1['name'] != '' ? $r_1['name'] : ''; if (isset($r_1['otherserial']) && !empty($r_1['otherserial'])) { - $i_name .= $r_1['otherserial'] != "" ? ($r_1['name'] != "" ? ' / ' . - $r_1['otherserial'] : $r_1['otherserial']) : ""; + $i_name .= $r_1['otherserial'] != '' ? ($r_1['name'] != '' ? ' / ' . + $r_1['otherserial'] : $r_1['otherserial']) : ''; } else { $i_name .= ''; } - } else if ($itemName == 3) { + } elseif ($itemName == 3) { if (isset($r_1['otherserial']) && !empty($r_1['otherserial'])) { - $i_name = $r_1['otherserial'] != "" ? $r_1['otherserial'] : ""; - $i_name .= $r_1['name'] != "" ? ($r_1['otherserial'] != "" ? ' / ' . - $r_1['name'] : $r_1['name']) : ""; + $i_name = $r_1['otherserial'] != '' ? $r_1['otherserial'] : ''; + $i_name .= $r_1['name'] != '' ? ($r_1['otherserial'] != '' ? ' / ' . + $r_1['name'] : $r_1['name']) : ''; } else { $i_name = $r_1['name']; } } - $url = Toolbox::getItemTypeFormURL($type) . "?id=" . $r_1['id']; - $pic = "ti ti-chevrons-right"; + $url = Toolbox::getItemTypeFormURL($type) . '?id=' . $r_1['id']; + $pic = 'ti ti-chevrons-right'; $name = strtr($i_name, $trans); - $opt = ['url' => $url, - 'pic' => $pic, - 'name' => $name + $opt = ['url' => $url, + 'pic' => $pic, + 'name' => $name, ]; $params = ['itemtype' => $type, - 'id' => $r_1['id'], - 'url' => $url, - 'pic' => $pic, - 'name' => $name + 'id' => $r_1['id'], + 'url' => $url, + 'pic' => $pic, + 'name' => $name, ]; $opt = Plugin::doHookFunction('treeview_params', $params); - // Add the item - echo "d.add(" . $tv_id++ . ", $pid, \"" . $opt['name'] . "\", true, -1, '" . + // Add the item + echo 'd.add(' . $tv_id++ . ", $pid, \"" . $opt['name'] . "\", true, -1, '" . $opt['url'] . "', '', '', '" . $opt['pic'] . "','" . $opt['pic'] . "');\n"; } } - // Add only the location without its items + // Add only the location without its items } else { - echo "d.add(" . $r['id'] . "," . $r['locations_id'] . ",\"" . strtr($l_name, $trans) . - "\", false, -1,'', '', '', '', '', false, true);\n"; + echo 'd.add(' . $r['id'] . ',' . $r['locations_id'] . ',"' . strtr($l_name, $trans) . + "\", false, -1,'', '', '', '', '', false, true);\n"; } } } } - // Print the node from JavaScript + // Print the node from JavaScript echo "document.write(d);\n"; - // Open the tree to the desired node + // Open the tree to the desired node if ($openedType != -1) { - echo "d.openTo(" . $openedType . ");\n"; + echo 'd.openTo(' . $openedType . ");\n"; } else { - echo "d.openTo(" . $nodes[count($nodes) - 1] . ");\n"; + echo 'd.openTo(' . $nodes[count($nodes) - 1] . ");\n"; } } - - /** - * Make sure that GLPI index page location is on top of window hierarchy - */ + /** + * Make sure that GLPI index page location is on top of window hierarchy + */ public static function loginPageToTop() { - echo Html::scriptBlock(" + echo Html::scriptBlock(' $(document).ready( public function() { if (top != self) top.location = self.location; }); - "); + '); } } diff --git a/inc/preference.class.php b/inc/preference.class.php index 55f1499..2140f4a 100644 --- a/inc/preference.class.php +++ b/inc/preference.class.php @@ -44,24 +44,24 @@ public static function getMenuContent() $menu['title'] = __('Tree view', 'treeview'); $menu['page'] = '/' . Plugin::getWebDir('treeview', false) . '/index.php'; $menu['icon'] = 'fas fa-sitemap'; + return $menu; } public function showFormUserPreference($target, $id) { - $data = plugin_version_treeview(); $this->getFromDB($id); echo ""; echo ""; echo ""; + echo ''; echo ""; - echo ""; - echo ""; + echo ''; + echo ''; echo ""; + echo ''; - echo "
" . sprintf(__('%1$s - %2$s'), $data['name'], $data['version']); - echo "
" . __('Launch the plugin Treeview with GLPI launching', 'treeview') . ""; - Dropdown::showYesNo("show_on_load", $this->fields["show_on_load"]); - echo "
' . __('Launch the plugin Treeview with GLPI launching', 'treeview') . ''; + Dropdown::showYesNo('show_on_load', $this->fields['show_on_load']); + echo '
"; echo ""; echo "" . __('Warning: If there are more than one plugin which be loaded at startup, then only the first will be used', 'treeview'); - echo "
"; + echo ''; Html::closeForm(); } - public function checkIfPreferenceExists($users_id) { /** @var DBmysql $DB */ @@ -85,25 +84,23 @@ public function checkIfPreferenceExists($users_id) $result = $DB->request([ 'SELECT' => ['id'], 'FROM' => 'glpi_plugin_treeview_preferences', - 'WHERE' => ['users_id' => $users_id] + 'WHERE' => ['users_id' => $users_id], ]); if (count($result) > 0) { return $result->current()['id']; } + return 0; } - public function addDefaultPreference($users_id) { - - $input["users_id"] = $users_id; - $input["show_on_load"] = 0; + $input['users_id'] = $users_id; + $input['show_on_load'] = 0; return $this->add($input); } - public function checkPreferenceValue($users_id) { /** @var DBmysql $DB */ @@ -112,36 +109,35 @@ public function checkPreferenceValue($users_id) $result = $DB->request([ 'SELECT' => ['show_on_load'], 'FROM' => 'glpi_plugin_treeview_preferences', - 'WHERE' => ['users_id' => $users_id] + 'WHERE' => ['users_id' => $users_id], ]); if (count($result) > 0) { return $result->current()['show_on_load']; } + return 0; } - public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if ($item->getType() == 'Preference') { return __('Tree view', 'treeview'); } + return ''; } - public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - if ($item->getType() == 'Preference') { - $pref = new self(); + $pref = new self(); $pref_ID = $pref->checkIfPreferenceExists(Session::getLoginUserID()); if (!$pref_ID) { $pref_ID = $pref->addDefaultPreference(Session::getLoginUserID()); } $pref->showFormUserPreference($pref->getFormURL(), $pref_ID); } + return true; } } diff --git a/inc/profile.class.php b/inc/profile.class.php index 44b6a3f..9acb3f5 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -36,67 +36,60 @@ class PluginTreeviewProfile extends CommonDBTM { public static function createFirstAccess($ID) { - $firstProf = new self(); if (!$firstProf->GetfromDB($ID)) { $profile = new Profile(); $profile->getFromDB($ID); - $name = addslashes($profile->fields["name"]); + $name = addslashes($profile->fields['name']); - $firstProf->add(['id' => $ID, - 'name' => $name, - 'treeview' => 'r' + $firstProf->add(['id' => $ID, + 'name' => $name, + 'treeview' => 'r', ]); } } - public function createAccess($profile) { - - return $this->add(['id' => $profile->getField('id'), - 'name' => addslashes($profile->getField('name')) + return $this->add(['id' => $profile->getField('id'), + 'name' => addslashes($profile->getField('name')), ]); } - public static function changeProfile() { - $prof = new self(); if ($prof->getFromDB($_SESSION['glpiactiveprofile']['id'])) { - $_SESSION["glpi_plugin_treeview_profile"] = $prof->fields; + $_SESSION['glpi_plugin_treeview_profile'] = $prof->fields; } else { - unset($_SESSION["glpi_plugin_treeview_profile"]); + unset($_SESSION['glpi_plugin_treeview_profile']); } - //require 'preference.class.php'; - $Pref = new PluginTreeviewPreference(); + //require 'preference.class.php'; + $Pref = new PluginTreeviewPreference(); $pref_value = $Pref->checkPreferenceValue(Session::getLoginUserID()); if ($pref_value == 1) { - $_SESSION["glpi_plugin_treeview_preference"] = 1; + $_SESSION['glpi_plugin_treeview_preference'] = 1; } else { - unset($_SESSION["glpi_plugin_treeview_preference"]); + unset($_SESSION['glpi_plugin_treeview_preference']); } } - - /** - * profiles modification - **/ + /** + * profiles modification + **/ public function showForm($id, $options = []) { - $target = $this->getFormURL(); if (isset($options['target'])) { $target = $options['target']; } - if (!Session::haveRight("profile", READ)) { + if (!Session::haveRight('profile', READ)) { return false; } - $canedit = Session::haveRight("profile", UPDATE); - $prof = new Profile(); + $canedit = Session::haveRight('profile', UPDATE); + $prof = new Profile(); if ($id) { $this->getFromDB($id); $prof->getFromDB($id); @@ -107,21 +100,21 @@ public function showForm($id, $options = []) echo "" . sprintf( __('%1$s %2$s'), __('Rights management'), - $this->fields["name"] + $this->fields['name'], ); - echo ""; + echo ''; echo ""; - echo "" . __('Use the tree', 'treeview') . ""; + echo '' . __('Use the tree', 'treeview') . ''; Profile::dropdownRight( - "treeview", - ['value' => $this->fields["treeview"], + 'treeview', + ['value' => $this->fields['treeview'], 'nonone' => 0, 'noread' => 0, - 'nowrite' => 1 - ] + 'nowrite' => 1, + ], ); - echo ""; + echo ''; if ($canedit) { echo ""; @@ -129,44 +122,40 @@ public function showForm($id, $options = []) echo ""; echo ""; - echo ""; + echo ''; } - echo ""; + echo ''; Html::closeForm(); return true; } - public static function cleanProfiles(Profile $prof) { - $plugprof = new self(); - $plugprof->delete(['id' => $prof->getField("id")]); + $plugprof->delete(['id' => $prof->getField('id')]); } - public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { - if ($item->getType() == 'Profile') { return __('Tree view', 'treeview'); } + return ''; } - public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - if ($item instanceof Profile) { $prof = new self(); - $ID = $item->getField('id'); + $ID = $item->getField('id'); if (!$prof->GetfromDB($ID)) { $prof->createAccess($item); } $prof->showForm($ID); } + return true; } } diff --git a/index.php b/index.php index 100d9d8..bc45949 100644 --- a/index.php +++ b/index.php @@ -32,6 +32,6 @@ Plugin::load('treeview', true); -$_SESSION["glpi_plugin_treeview_loaded"] = 1; -$config = new PluginTreeviewConfig(); +$_SESSION['glpi_plugin_treeview_loaded'] = 1; +$config = new PluginTreeviewConfig(); $config->seeTreeview(); diff --git a/left.php b/left.php index c31d3db..013f9ca 100644 --- a/left.php +++ b/left.php @@ -34,28 +34,28 @@ $treeview_url = Plugin::getWebDir('treeview'); -Html::includeHeader("TreeView"); +Html::includeHeader('TreeView'); echo ""; // Title bar echo '
'; -echo '
' . sprintf(__('%1$s - %2$s'), "GLPI", __('Tree view', 'treeview')); +echo '
' . sprintf(__('%1$s - %2$s'), 'GLPI', __('Tree view', 'treeview')); echo '
'; -echo "
"; +echo '
'; echo "
"; -echo "
"; +echo '
'; -echo ""; +echo ""; // The IDs (primary key) of the requested nodes are stored in this field echo ""; // Which item type should be opened? echo ""; -echo ""; +echo ''; // Print the tree $config = new PluginTreeviewConfig(); $config->buildTreeview(); -echo ""; -echo ""; +echo ''; +echo ''; diff --git a/setup.php b/setup.php index d8a9eed..c1acca1 100644 --- a/setup.php +++ b/setup.php @@ -52,23 +52,23 @@ function plugin_init_treeview() Plugin::registerClass('PluginTreeviewProfile', ['addtabon' => ['Profile']]); - $PLUGIN_HOOKS['change_profile']['treeview'] = ['PluginTreeviewProfile','changeprofile']; + $PLUGIN_HOOKS['change_profile']['treeview'] = ['PluginTreeviewProfile', 'changeprofile']; if ( - isset($_SESSION["glpi_plugin_treeview_profile"]) - && $_SESSION["glpi_plugin_treeview_profile"]["treeview"] + isset($_SESSION['glpi_plugin_treeview_profile']) + && $_SESSION['glpi_plugin_treeview_profile']['treeview'] ) { $PLUGIN_HOOKS['menu_toadd']['treeview']['tools'] = 'PluginTreeviewPreference'; $PLUGIN_HOOKS['pre_item_purge']['treeview'] = [ - 'Profile' => ['PluginTreeviewProfile', 'cleanProfiles'] + 'Profile' => ['PluginTreeviewProfile', 'cleanProfiles'], ]; $PLUGIN_HOOKS['change_entity']['treeview'] = 'plugin_change_entity_Treeview'; if ( - isset($_SESSION["glpi_plugin_treeview_loaded"]) - && $_SESSION["glpi_plugin_treeview_loaded"] == 1 + isset($_SESSION['glpi_plugin_treeview_loaded']) + && $_SESSION['glpi_plugin_treeview_loaded'] == 1 && class_exists('PluginTreeviewConfig') ) { foreach (PluginTreeviewConfig::getTypes() as $type) { @@ -79,38 +79,38 @@ function plugin_init_treeview() } if ( - $_SERVER['PHP_SELF'] == $CFG_GLPI["root_doc"] . "/front/central.php" - && (!isset($_SESSION["glpi_plugin_treeview_loaded"]) - || $_SESSION["glpi_plugin_treeview_loaded"] == 0) - && isset($_SESSION["glpi_plugin_treeview_preference"]) - && $_SESSION["glpi_plugin_treeview_preference"] == 1 + $_SERVER['PHP_SELF'] == $CFG_GLPI['root_doc'] . '/front/central.php' + && (!isset($_SESSION['glpi_plugin_treeview_loaded']) + || $_SESSION['glpi_plugin_treeview_loaded'] == 0) + && isset($_SESSION['glpi_plugin_treeview_preference']) + && $_SESSION['glpi_plugin_treeview_preference'] == 1 ) { - Html::redirect(Plugin::getWebDir('treeview') . "/index.php"); + Html::redirect(Plugin::getWebDir('treeview') . '/index.php'); } if ( - $_SERVER['PHP_SELF'] == $CFG_GLPI["root_doc"] . "/front/logout.php" - && (isset($_SESSION["glpi_plugin_treeview_loaded"]) - && $_SESSION["glpi_plugin_treeview_loaded"] == 1 + $_SERVER['PHP_SELF'] == $CFG_GLPI['root_doc'] . '/front/logout.php' + && (isset($_SESSION['glpi_plugin_treeview_loaded']) + && $_SESSION['glpi_plugin_treeview_loaded'] == 1 && class_exists('PluginTreeviewConfig')) ) { $config = new PluginTreeviewConfig(); $config->hideTreeview(); } - // Add specific files to add to the header : javascript or css - $PLUGIN_HOOKS['add_css']['treeview'] = "css/treeview.css"; + // Add specific files to add to the header : javascript or css + $PLUGIN_HOOKS['add_css']['treeview'] = 'css/treeview.css'; } - // Config page - if (Session::haveRight("config", UPDATE) || Session::haveRight("profile", UPDATE)) { + // Config page + if (Session::haveRight('config', UPDATE) || Session::haveRight('profile', UPDATE)) { $PLUGIN_HOOKS['config_page']['treeview'] = 'front/config.form.php'; } - $currentPage = explode("/", $_SERVER['PHP_SELF']); - if (array_pop($currentPage) == "index.php") { + $currentPage = explode('/', $_SERVER['PHP_SELF']); + if (array_pop($currentPage) == 'index.php') { $PLUGIN_HOOKS['display_login']['treeview'] = [ - "PluginTreeviewConfig", - "loginPageToTop" + 'PluginTreeviewConfig', + 'loginPageToTop', ]; } } @@ -121,7 +121,6 @@ function plugin_init_treeview() **/ function plugin_version_treeview() { - return [ 'name' => __('Tree view', 'treeview'), 'version' => PLUGIN_TREEVIEW_VERSION, @@ -132,8 +131,8 @@ function plugin_version_treeview() 'glpi' => [ 'min' => PLUGIN_TREEVIEW_MIN_GLPI, 'max' => PLUGIN_TREEVIEW_MAX_GLPI, - ] - ] + ], + ], ]; }