Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
* 7.0:
  Remove redundant parenthesis on attribute
  • Loading branch information
OskarStark committed May 21, 2024
2 parents 4d77e25 + f367fad commit 5e9e248
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ return a ``Response``.

There is a default listener inside the Symfony Framework for the ``kernel.view``
event. If your controller action returns an array, and you apply the
:ref:`#[Template()] attribute <templates-template-attribute>` to that
:ref:`#[Template] attribute <templates-template-attribute>` to that
controller action, then this listener renders a template, passes the array
you returned from your controller to that template, and creates a ``Response``
containing the returned content from that template.
Expand Down
2 changes: 1 addition & 1 deletion controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Make sure to install `phpstan/phpdoc-parser`_ and `phpdocumentor/type-resolver`_
if you want to map a nested array of specific DTOs::

public function dashboard(
#[MapRequestPayload()] EmployeesDto $employeesDto
#[MapRequestPayload] EmployeesDto $employeesDto
): Response
{
// ...
Expand Down
2 changes: 1 addition & 1 deletion http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Additionally, most cache-related HTTP headers can be set via the single

.. tip::

All these options are also available when using the ``#[Cache()]`` attribute.
All these options are also available when using the ``#[Cache]`` attribute.

Cache Invalidation
------------------
Expand Down
2 changes: 1 addition & 1 deletion http_cache/cache_vary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trigger a different representation of the requested resource:
resource based on the URI and the value of the ``Accept-Encoding`` and
``User-Agent`` request header.

Set the ``Vary`` header via the ``Response`` object methods or the ``#[Cache()]``
Set the ``Vary`` header via the ``Response`` object methods or the ``#[Cache]``
attribute::

.. configuration-block::
Expand Down
2 changes: 1 addition & 1 deletion http_cache/expiration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ or disadvantage to either.

According to the HTTP specification, "the ``Expires`` header field gives
the date/time after which the response is considered stale." The ``Expires``
header can be set with the ``expires`` option of the ``#[Cache()]`` attribute or
header can be set with the ``expires`` option of the ``#[Cache]`` attribute or
the ``setExpires()`` ``Response`` method::

.. configuration-block::
Expand Down
2 changes: 1 addition & 1 deletion security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,7 @@ will happen:
.. _security-securing-controller-annotations:
.. _security-securing-controller-attributes:

Another way to secure one or more controller actions is to use the ``#[IsGranted()]`` attribute.
Another way to secure one or more controller actions is to use the ``#[IsGranted]`` attribute.
In the following example, all controller actions will require the
``ROLE_ADMIN`` permission, except for ``adminDashboard()``, which will require
the ``ROLE_SUPER_ADMIN`` permission:
Expand Down
4 changes: 2 additions & 2 deletions security/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Using Expressions in Security Access Controls
the :doc:`Voter System </security/voters>`.

In addition to security roles like ``ROLE_ADMIN``, the ``isGranted()`` method
and ``#[IsGranted()]`` attribute also accept an
and ``#[IsGranted]`` attribute also accept an
:class:`Symfony\\Component\\ExpressionLanguage\\Expression` object:

.. configuration-block::
Expand Down Expand Up @@ -138,7 +138,7 @@ Additionally, you have access to a number of functions inside the expression:
true if the user has actually logged in during this session (i.e. is
full-fledged).

In case of the ``#[IsGranted()]`` attribute, the subject can also be an
In case of the ``#[IsGranted]`` attribute, the subject can also be an
:class:`Symfony\\Component\\ExpressionLanguage\\Expression` object::

// src/Controller/MyController.php
Expand Down
2 changes: 1 addition & 1 deletion security/voters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ code like this:
}
}
The ``#[IsGranted()]`` attribute or ``denyAccessUnlessGranted()`` method (and also the ``isGranted()`` method)
The ``#[IsGranted]`` attribute or ``denyAccessUnlessGranted()`` method (and also the ``isGranted()`` method)
calls out to the "voter" system. Right now, no voters will vote on whether or not
the user can "view" or "edit" a ``Post``. But you can create your *own* voter that
decides this using whatever logic you want.
Expand Down
4 changes: 2 additions & 2 deletions templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ use the ``render()`` method of the ``twig`` service.

.. _templates-template-attribute:

Another option is to use the ``#[Template()]`` attribute on the controller method
Another option is to use the ``#[Template]`` attribute on the controller method
to define the template to render::

// src/Controller/ProductController.php
Expand All @@ -583,7 +583,7 @@ to define the template to render::
{
// ...

// when using the #[Template()] attribute, you only need to return
// when using the #[Template] attribute, you only need to return
// an array with the parameters to pass to the template (the attribute
// is the one which will create and return the Response object).
return [
Expand Down

0 comments on commit 5e9e248

Please sign in to comment.