11
11
12
12
namespace Symfony \UX \TwigComponent \Twig ;
13
13
14
- use Symfony \UX \TwigComponent \CVA ;
15
- use Twig \DeprecatedCallableInfo ;
16
14
use Twig \Extension \AbstractExtension ;
17
15
use Twig \TwigFunction ;
18
16
@@ -27,11 +25,6 @@ public function getFunctions(): array
27
25
{
28
26
return [
29
27
new TwigFunction ('component ' , [ComponentRuntime::class, 'render ' ], ['is_safe ' => ['all ' ]]),
30
- new TwigFunction ('cva ' , [$ this , 'cva ' ], [
31
- ...(class_exists (DeprecatedCallableInfo::class)
32
- ? ['deprecation_info ' => new DeprecatedCallableInfo ('symfony/ux-twig-component ' , '2.20 ' , 'html_cva ' , 'twig/html-extra ' )]
33
- : ['deprecated ' => '2.20 ' , 'deprecating_package ' => 'symfony/ux-twig-component ' , 'alternative ' => 'html_cva ' ]),
34
- ]),
35
28
];
36
29
}
37
30
@@ -42,33 +35,4 @@ public function getTokenParsers(): array
42
35
new PropsTokenParser (),
43
36
];
44
37
}
45
-
46
- /**
47
- * Create a CVA instance.
48
- *
49
- * base some base class you want to have in every matching recipes
50
- * variants your recipes class
51
- * compoundVariants compounds allow you to add extra class when multiple variation are matching in the same time
52
- * defaultVariants allow you to add a default class when no recipe is matching
53
- *
54
- * @see https://symfony.com/bundles/ux-twig-component/current/index.html#component-with-complex-variants-cva
55
- *
56
- * @param array{
57
- * base: string|string[]|null,
58
- * variants: array<string, array<string, string|string[]>>,
59
- * compoundVariants: list<array<string, string|string[]>>,
60
- * defaultVariants: array<string, string>,
61
- * } $cva
62
- */
63
- public function cva (array $ cva ): CVA
64
- {
65
- trigger_deprecation ('symfony/ux-twig-component ' , '2.20 ' , 'Twig Function "cva" is deprecated; use "html_cva" from the "twig/html-extra" package (available since version 3.12) instead. ' );
66
-
67
- return new CVA (
68
- $ cva ['base ' ] ?? '' ,
69
- $ cva ['variants ' ] ?? [],
70
- $ cva ['compoundVariants ' ] ?? [],
71
- $ cva ['defaultVariants ' ] ?? [],
72
- );
73
- }
74
38
}
0 commit comments