Commit c7a108a1 authored by Fabien Potencier's avatar Fabien Potencier

minor #1517 Clarify documentations around protected closures. (jordanlev)

This PR was merged into the 2.1.x-dev branch.

Discussion
----------

Clarify documentations around protected closures.

The docs state that "protected closures do not get access to the container", but this is somewhat misleading (it confused me for a quite some time). It's true that protected closures are not passed the container as a function argument, but they can access the container via `use ($app)`.

Commits
-------

45d9113d Clarify documentations around protected closures.
parents 74a6de7e 45d9113d
...@@ -159,7 +159,7 @@ using the ``protect`` method:: ...@@ -159,7 +159,7 @@ using the ``protect`` method::
// calling it now // calling it now
echo $add(2, 3); echo $add(2, 3);
Note that protected closures do not get access to the container. Note that the container is not provided as an argument to protected closures (but you can access it via `use($app)`).
Core services Core services
------------- -------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment