Skip to content

Commit

Permalink
typehint instead of checkArrow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenz authored and fabpot committed Jan 12, 2025
1 parent f271158 commit edecc13
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 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'], ['needs_environment' => true]),
new TwigFilter('invoke', [self::class, 'invoke']),
];
}

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

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

Expand Down

0 comments on commit edecc13

Please sign in to comment.