Skip to content

Commit

Permalink
checkArrow, typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz committed Dec 30, 2024
1 parent d0612c9 commit 6648637
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Extension/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function getFilters(): array
// iteration and runtime
new TwigFilter('default', [self::class, 'default'], ['node_class' => DefaultFilter::class]),
new TwigFilter('keys', [self::class, 'keys']),
new TwigFilter('invoke', [self::class, 'invoke']),
new TwigFilter('invoke', [self::class, 'invoke'], ['needs_environment' => true]),
];
}

Expand Down Expand Up @@ -919,15 +919,15 @@ public static function keys($array): array
/**
* Invokes a callable
*
* @param callable $callable
* @param ...$arguments
* @return mixed
* @param \Closure $arrow
*
* @internal
*/
public static function invoke(callable $callable, ...$arguments): mixed
public static function invoke(Environment $env, $arrow, ...$arguments): mixed
{
return $callable(...$arguments);
self::checkArrow($env, $arrow, 'invoke', 'filter');

return $arrow(...$arguments);
}

/**
Expand Down

0 comments on commit 6648637

Please sign in to comment.