Skip to content

Commit

Permalink
fix expression language configuration to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Mar 22, 2024
1 parent 0f6b042 commit 41169ba
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Resources/doc/overview.rst
Original file line number Diff line number Diff line change
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
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion tests/Resources/Fixtures/config/full.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 41169ba

Please sign in to comment.