Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/sets/symfony/composer-based.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
// symfony/validator 8.1
ConstraintValidatorValidateToValidateInContextRector::class,

// twig/twig 3.21
// twig/twig 3.21 + symfony/twig-bridge 7.3
GetFiltersAndFunctionsToAsTwigAttributeRector::class,

// jms/serializer 3.14
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"require": {
"twig/twig": "^3.21"
"twig/twig": "^3.21",
"symfony/twig-bridge": "^7.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ public function __construct(
) {
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
/**
* @return ComposerPackageConstraint[]
*/
public function provideComposerPackageConstraint(): array
{
return new ComposerPackageConstraint('twig/twig', '>=3.21');
// the #[AsTwig*] attributes exist in twig/twig 3.21, but Symfony only autoregisters extension-less
// classes from them in symfony/twig-bridge 7.3; without both, the stripped TwigExtension is silently lost
return [
new ComposerPackageConstraint('twig/twig', '>=3.21'),
new ComposerPackageConstraint('symfony/twig-bridge', '>=7.3'),
];
}

public function getRuleDefinition(): RuleDefinition
Expand Down
Loading