From d0a2a1f01e78788e32a3e9a95befe9c5315296e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 13:32:20 +0000 Subject: [PATCH 1/2] Build(deps): Bump actions/stale from 10 to 11 Bumps [actions/stale](https://github.com/actions/stale) from 10 to 11. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v10...v11) --- updated-dependencies: - dependency-name: actions/stale dependency-version: '11' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/close_stale_issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close_stale_issue.yml b/.github/workflows/close_stale_issue.yml index 924a2bc8..b0f952bc 100644 --- a/.github/workflows/close_stale_issue.yml +++ b/.github/workflows/close_stale_issue.yml @@ -10,7 +10,7 @@ jobs: issues: write # for actions/stale to close stale issues runs-on: ubuntu-latest steps: - - uses: actions/stale@v10 + - uses: actions/stale@v11 with: stale-issue-message: >- There has been no activity on this issue for some time and therefore it is considered stale From 89655ce5f61e7bdf3febdaa51b0915835d975e63 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Mon, 3 Aug 2026 14:36:02 +0200 Subject: [PATCH 2/2] lint --- inc/tagitem.class.php | 9 +-------- rector.php | 47 ++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/inc/tagitem.class.php b/inc/tagitem.class.php index 743d5ffc..f06709ca 100644 --- a/inc/tagitem.class.php +++ b/inc/tagitem.class.php @@ -475,14 +475,7 @@ public static function updateItem(CommonDBTM $item, bool $delete_existing_tags = if ( $item->getID() && !isset($item->input["_plugin_tag_tag_process_form"]) - && !( - // Always trigger on newly created tickets, as they may come from - // the mail collector which wont set the _plugin_tag_tag_process_form - // flag - $item::getType() == Ticket::getType() - // Allow a few seconds difference if glpi_currenttime changed - && abs(strtotime((string) $item->fields['date_creation']) - strtotime((string) $_SESSION['glpi_currenttime'])) < 5 - ) + && ($item::getType() != Ticket::getType() || abs(strtotime((string) $item->fields['date_creation']) - strtotime((string) $_SESSION['glpi_currenttime'])) >= 5) ) { return true; } diff --git a/rector.php b/rector.php index b738e1db..54d3dc10 100644 --- a/rector.php +++ b/rector.php @@ -28,31 +28,28 @@ * ------------------------------------------------------------------------- */ +use Rector\Configuration\RectorConfigBuilder; + require_once __DIR__ . '/../../src/Plugin.php'; -use Rector\Caching\ValueObject\Storage\FileCacheStorage; -use Rector\Config\RectorConfig; -use Rector\ValueObject\PhpVersion; +$baseline_file = __DIR__ . '/../../PluginsRector.php'; +if (!file_exists($baseline_file)) { + throw new RuntimeException( + sprintf( + 'Unable to find "%s". Running rector on a plugin requires a GLPI development checkout that ships PluginsRector.php.', + $baseline_file, + ), + ); +} + +$baseline = require $baseline_file; + +/** @var RectorConfigBuilder $config */ +$config = $baseline([ + __DIR__ . '/ajax', + __DIR__ . '/inc', + __DIR__ . '/stubs', + __DIR__ . '/tests', +]); -return RectorConfig::configure() - ->withPaths([ - __DIR__ . '/ajax', - __DIR__ . '/inc', - __DIR__ . '/stubs', - __DIR__ . '/tests', - ]) - ->withPhpVersion(PhpVersion::PHP_82) - ->withCache( - cacheDirectory: __DIR__ . '/var/rector', - cacheClass: FileCacheStorage::class, - ) - ->withRootFiles() - ->withParallel(timeoutSeconds: 300) - ->withImportNames(removeUnusedImports: true) - ->withPreparedSets( - deadCode: true, - codeQuality: true, - codingStyle: true, - ) - ->withPhpSets(php82: true) // apply PHP sets up to PHP 8.2 -; +return $config;