File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 3030use Twig \Environment ;
3131use Twig \Extension \AbstractExtension ;
3232use Twig \TwigFunction ;
33- use Twig_SimpleFunction ;
3433
3534class TwigExtension extends AbstractExtension
3635{
@@ -78,17 +77,10 @@ public function setAliases(array $aliases): void
7877 * @psalm-suppress UndefinedDocblockClass
7978 * @psalm-suppress ImplementedReturnTypeMismatch
8079 *
81- * @psalm-return list<TwigFunction|Twig_SimpleFunction >
80+ * @psalm-return list<TwigFunction>
8281 */
8382 public function getFunctions (): array
8483 {
85- if (\version_compare (Environment::VERSION , '2 ' ) < 0 ) {
86- /** @psalm-suppress UndefinedClass */
87- $ class = Twig_SimpleFunction::class; // @codeCoverageIgnore
88- } else {
89- $ class = TwigFunction::class;
90- }
91-
9284 $ opts = [
9385 'is_safe ' => ['html ' ],
9486 'is_variadic ' => true ,
@@ -99,7 +91,7 @@ public function getFunctions(): array
9991 $ ret = [];
10092
10193 foreach ($ this ->aliases as $ alias => $ renderer ) {
102- $ ret [] = new $ class (
94+ $ ret [] = new TwigFunction (
10395 $ alias ,
10496 function (Environment $ env , array $ context , array $ args = []) use ($ alias ) {
10597 return $ this ->dump ($ alias , $ env , $ context , $ args );
You can’t perform that action at this time.
0 commit comments