From 34a035a2c4765b932b4443fd383c84da8d1566a7 Mon Sep 17 00:00:00 2001 From: MrYamous Date: Tue, 14 Jul 2026 10:47:47 +0200 Subject: [PATCH] [Twig30] Add new set for Twig 30 --- config/sets/twig/twig30.php | 19 +++++++++++++++++++ src/Set/SetProvider/TwigSetProvider.php | 6 ++++++ src/Set/TwigSetList.php | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 config/sets/twig/twig30.php diff --git a/config/sets/twig/twig30.php b/config/sets/twig/twig30.php new file mode 100644 index 000000000..57140315a --- /dev/null +++ b/config/sets/twig/twig30.php @@ -0,0 +1,19 @@ +ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [ + new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getFilters', new ArrayType(new MixedType(), new MixedType())), + new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getTests', new ArrayType(new MixedType(), new MixedType())), + new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getFunctions', new ArrayType(new MixedType(), new MixedType())), + ]); +}; + diff --git a/src/Set/SetProvider/TwigSetProvider.php b/src/Set/SetProvider/TwigSetProvider.php index ed83a9ad1..c6aca75d8 100644 --- a/src/Set/SetProvider/TwigSetProvider.php +++ b/src/Set/SetProvider/TwigSetProvider.php @@ -53,6 +53,12 @@ public function provide(): array '2.4', __DIR__ . '/../../../config/sets/twig/twig24.php' ), + new ComposerTriggeredSet( + SetGroup::TWIG, + 'twig/twig', + '3.0', + __DIR__ . '/../../../config/sets/twig/twig30.php' + ), ]; } } diff --git a/src/Set/TwigSetList.php b/src/Set/TwigSetList.php index 5e6844216..6b9369c3b 100644 --- a/src/Set/TwigSetList.php +++ b/src/Set/TwigSetList.php @@ -21,5 +21,7 @@ final class TwigSetList public const string TWIG_24 = __DIR__ . '/../../config/sets/twig/twig24.php'; + public const string TWIG_30 = __DIR__ . '/../../config/sets/twig/twig30.php'; + public const string TWIG_UNDERSCORE_TO_NAMESPACE = __DIR__ . '/../../config/sets/twig/twig-underscore-to-namespace.php'; }