diff --git a/.twig_cs.dist.php b/.twig_cs.dist.php new file mode 100644 index 00000000..352fe0a6 --- /dev/null +++ b/.twig_cs.dist.php @@ -0,0 +1,15 @@ +in(__DIR__ . '/templates') + ->name('*.html.twig') + ->ignoreVCSIgnored(true); + +return Twigcs\Config\Config::create() + ->setFinder($finder) + ->setRuleSet(\Glpi\Tools\GlpiTwigRuleset::class) +; diff --git a/composer.json b/composer.json index db8b41a8..4a460f31 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.75", + "friendsoftwig/twigcs": "^6.1", "glpi-project/tools": "^0.7.4", "php-parallel-lint/php-parallel-lint": "^1.4", "phpstan/extension-installer": "^1.4", @@ -20,5 +21,10 @@ "allow-plugins": { "phpstan/extension-installer": true } + }, + "autoload-dev": { + "psr-4": { + "Glpi\\Tools\\": "../../tools/src/" + } } } diff --git a/composer.lock b/composer.lock index 54916b83..495c2751 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": "aa2b1621d126bd003fdb3efcc09d4d24", + "content-hash": "edee4b40b4a23f0b5146a771fc5e5322", "packages": [ { "name": "symfony/deprecation-contracts", @@ -731,6 +731,61 @@ ], "time": "2025-03-31T18:40:42+00:00" }, + { + "name": "friendsoftwig/twigcs", + "version": "v6.1.0", + "source": { + "type": "git", + "url": "https://github.com/friendsoftwig/twigcs.git", + "reference": "3c36d606c4f19db0dd2a01b735ec7a8151b7f182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/friendsoftwig/twigcs/zipball/3c36d606c4f19db0dd2a01b735ec7a8151b7f182", + "reference": "3c36d606c4f19db0dd2a01b735ec7a8151b7f182", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "symfony/console": "^4.4 || ^5.3 || ^6.0", + "symfony/filesystem": "^4.4 || ^5.3 || ^6.0", + "symfony/finder": "^4.4 || ^5.3 || ^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.20", + "symfony/phpunit-bridge": "^6.2.3" + }, + "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/v6.1.0" + }, + "time": "2023-01-04T16:01:24+00:00" + }, { "name": "glpi-project/tools", "version": "0.7.4", @@ -898,16 +953,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.11", + "version": "2.1.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30" + "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30", - "reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", + "reference": "96dde49e967c0c22812bcfa7bda4ff82c09f3b0c", "shasum": "" }, "require": { @@ -952,7 +1007,7 @@ "type": "github" } ], - "time": "2025-03-24T13:45:00+00:00" + "time": "2025-04-16T13:19:18+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -3050,15 +3105,15 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.4.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/templates/container_display_conditions.html.twig b/templates/container_display_conditions.html.twig index fdb6e62d..6e95ca43 100644 --- a/templates/container_display_conditions.html.twig +++ b/templates/container_display_conditions.html.twig @@ -32,7 +32,7 @@