Skip to content

Commit

Permalink
Merge pull request #616 from FriendsOfSymfony/2-to-3
Browse files Browse the repository at this point in the history
2 to 3
  • Loading branch information
dbu committed Mar 22, 2024
2 parents 3551603 + 41169ba commit 9b9d9d9
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Resources/doc/conf.py
Expand Up @@ -14,6 +14,7 @@
extensions = [
'sphinxcontrib.spelling',
'sphinx_rtd_theme',
"sphinx.ext.intersphinx",
]

# Spelling configuration
Expand Down Expand Up @@ -197,7 +198,7 @@

# --------------

intersphinx_mapping = {'foshttpcache': ('http://foshttpcache.readthedocs.org/en/latest/', None)}
intersphinx_mapping = {'foshttpcache': ('http://foshttpcache.readthedocs.io/en/latest/', None)}

rst_epilog = """
.. _expressions: https://symfony.com/doc/current/components/expression_language.html
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/includes/expression-language.rst
Expand Up @@ -4,8 +4,8 @@
**type**: ``string``

If your application is using a `custom expression language`_ which is extended
from Symfony's `expression language component`_, you can `define it as a service`_
and include it in the configuration.
from Symfony's `expression language component`_, you need to `define it as a service`_
and configure it as `expression_language` in the sections where you want to use it.

.. _expression language component: https://symfony.com/doc/current/components/expression_language.html
.. _define it as a service: https://symfony.com/doc/current/controller/service.html
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/overview.rst
Expand Up @@ -45,7 +45,7 @@ Optional Dependencies
ExpressionLanguage
~~~~~~~~~~~~~~~~~~

If you wish to use expressions_ in your :ref:`attributes <reference/attributes.rst>`,
If you wish to use expressions in your :doc:`attributes <reference/attributes>`,
you need Symfony’s ExpressionLanguage_ component. Make sure it is part of your application with:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/reference/configuration/tags.rst
Expand Up @@ -137,7 +137,7 @@ unsafe requests.
**type**: ``array``

You can dynamically refer to request attributes using
:ref:`expressions <expression language requirement>`. Assume a route
:ref:`expressions <requirements>`. Assume a route
``/articles/{id}``. A request to path ``/articles/123`` will set/invalidate
tag ``articles-123`` with the following configuration:

Expand Down
10 changes: 5 additions & 5 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -426,8 +426,8 @@ private function addMatch(NodeBuilder $rules, $matchResponse = false)
->defaultNull()
->info('Expression to decide whether response should be matched. Replaces cacheable configuration.')
->end()
->scalarNode('match_response_expression_service')
->info('Service name of the expression language service to use for expression evaluation. If not specified, the default expression language is used')
->scalarNode('expression_language')
->info('Service name of a custom ExpressionLanguage to use.')
->end()
;
}
Expand Down Expand Up @@ -808,7 +808,7 @@ private function addTagSection(ArrayNodeDefinition $rootNode)
->booleanNode('strict')->defaultFalse()->end()
->scalarNode('expression_language')
->defaultNull()
->info('Service name of a custom ExpressionLanugage to use.')
->info('Service name of a custom ExpressionLanguage to use.')
->end()
->scalarNode('response_header')
->defaultNull()
Expand All @@ -830,7 +830,7 @@ private function addTagSection(ArrayNodeDefinition $rootNode)
->ifTrue(function ($v) {
return !empty($v['tag_expressions']) && !class_exists(ExpressionLanguage::class);
})
->thenInvalid('Configured a tag_expression but ExpressionLanugage is not available')
->thenInvalid('Configured a tag_expression but ExpressionLanguage is not available')
->end()
->children()
;
Expand Down Expand Up @@ -863,7 +863,7 @@ private function addInvalidationSection(ArrayNodeDefinition $rootNode)
->end()
->scalarNode('expression_language')
->defaultNull()
->info('Service name of a custom ExpressionLanugage to use.')
->info('Service name of a custom ExpressionLanguage to use.')
->end()
->arrayNode('rules')
->info('Set what requests should invalidate which target routes.')
Expand Down
2 changes: 1 addition & 1 deletion tests/Resources/Fixtures/config/full.php
Expand Up @@ -29,7 +29,7 @@
'ips' => ['1.2.3.4', '1.1.1.1'],
'attributes' => ['_controller' => 'fos.user_bundle.*'],
'match_response' => 'response.getStatusCode() == 404',
'match_response_expression_service' => 'my.custom.expression-service',
'expression_language' => 'my.custom.expression-service',
],
'headers' => [
'overwrite' => false,
Expand Down
2 changes: 1 addition & 1 deletion tests/Resources/Fixtures/config/full.xml
Expand Up @@ -18,7 +18,7 @@
host="fos"
query_string="(^|&amp;)foo="
match_response="response.getStatusCode() == 404"
match_response_expression_service = "my.custom.expression-service"
expression_language = "my.custom.expression-service"
>
<method>GET</method>
<method>POST</method>
Expand Down
2 changes: 1 addition & 1 deletion tests/Resources/Fixtures/config/full.yml
Expand Up @@ -24,7 +24,7 @@ fos_http_cache:
attributes:
_controller: fos.user_bundle.*
match_response: "response.getStatusCode() == 404"
match_response_expression_service: my.custom.expression-service
expression_language: my.custom.expression-service
headers:
overwrite: false
cache_control:
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/DependencyInjection/ConfigurationTest.php
Expand Up @@ -72,7 +72,7 @@ public function testSupportsAllConfigFormats()
'ips' => ['1.2.3.4', '1.1.1.1'],
'attributes' => ['_controller' => 'fos.user_bundle.*'],
'match_response' => 'response.getStatusCode() == 404',
'match_response_expression_service' => 'my.custom.expression-service',
'expression_language' => 'my.custom.expression-service',
'additional_response_status' => [],
],
'headers' => [
Expand Down

0 comments on commit 9b9d9d9

Please sign in to comment.