Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Fabien Potencier <[email protected]>
  • Loading branch information
Lorenzschaef and fabpot authored Jan 9, 2025
1 parent dd0ff41 commit 9ffe0fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions doc/filters/invoke.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
``invoke``
=======
==========

The ``invoke`` filter invokes an arrow function with the given arguments:

.. code-block:: twig
{% set person = {first: "Bob", last: "Smith"} %}
{% set person = { first: "Bob", last: "Smith" } %}
{% set func = p => "#{p.first} #{p.last}" %}
{{ func|invoke(person) }}
Expand All @@ -16,4 +16,4 @@ Note that the arrow function has access to the current context.
Arguments
---------

All given arguments are passed to the arrow function
All given arguments are passed to the arrow function.
4 changes: 2 additions & 2 deletions doc/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,9 @@ The following operators don't fit into any of the other categories:
Arrow function support for functions, macros, and method calls was added in
Twig 3.15 (filters and tests were already supported).

Arrow functions can be invoked using the ``invoke`` filter.
Arrow functions can be called using the ``invoke`` filter:

.. versionadded:: 3.19
.. versionadded:: 3.19

The ``invoke`` filter has been added in Twig 3.19.

Expand Down

0 comments on commit 9ffe0fc

Please sign in to comment.