You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($class->implementsInterface(ExtensionInterface::class)) {
41
+
if ($class->isSubclassOf(AbstractExtension::class)) {
42
+
thrownewLogicException(\sprintf('The class "%s" cannot extend "%s" and use the "#[%s]" attribute on method "%s()", choose one or the other.', $class->name, AbstractExtension::class, $attribute::class, $reflector->name));
43
+
}
44
+
thrownewLogicException(\sprintf('The class "%s" cannot implement "%s" and use the "#[%s]" attribute on method "%s()", choose one or the other.', $class->name, ExtensionInterface::class, $attribute::class, $reflector->name));
45
+
}
46
+
36
47
$definition->addTag(self::TAG);
37
48
38
49
// The service must be tagged as a runtime to call non-static methods
$this->expectExceptionMessage('The class "Symfony\Bundle\TwigBundle\Tests\Functional\InvalidExtensionWithAttributes" cannot extend "Twig\Extension\AbstractExtension" and use the "#[Twig\Attribute\AsTwigFilter]" attribute on method "funFilter()", choose one or the other.');
89
+
90
+
$kernel->boot();
91
+
}
92
+
93
+
76
94
/**
77
95
* @before
78
96
* @after
79
97
*/
98
+
#[Before, After]
80
99
protectedfunctiondeleteTempDir()
81
100
{
82
101
if (file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/AttributeExtension')) {
@@ -85,6 +104,24 @@ protected function deleteTempDir()
0 commit comments