Skip to content

Commit 1b99d94

Browse files
author
Till Hildebrandt
committed
pull request feedback
- fixed cache listener configuration - proper usage of xml configuration
1 parent 9902966 commit 1b99d94

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ private function createCachePluginNode()
718718
$config
719719
->fixXmlConfig('method')
720720
->fixXmlConfig('respect_response_cache_directive')
721+
->fixXmlConfig('cache_listener')
721722
->addDefaultsIfNotSet()
722723
->validate()
723724
->ifTrue(function ($config) {
@@ -771,7 +772,7 @@ private function createCachePluginNode()
771772
->end()
772773
->arrayNode('cache_listeners')
773774
->info('A list of service ids to act on the response based on the results of the cache check. Must implement '.CacheListener::class.'. Defaults to an empty array.')
774-
->beforeNormalization()->ifNull()->thenEmptyArray()->castToArray()->ifEmpty()->thenUnset()->end()
775+
->beforeNormalization()->castToArray()->end()
775776
->prototype('scalar')
776777
->end()
777778
->end()

tests/Resources/Fixtures/config/full.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
</authentication>
6363
<cache cache-pool="my_cache_pool" stream-factory="my_other_stream_factory">
6464
<config default-ttl="42" cache-lifetime="2592000" hash-algo="sha1" cache-key-generator="null">
65-
<cache-listeners>my_cache_listener_0</cache-listeners>
66-
<cache-listeners>my_cache_listener_1</cache-listeners>
65+
<cache-listener>my_cache_listener_0</cache-listener>
66+
<cache-listener>my_cache_listener_1</cache-listener>
6767
<respect-response-cache-directive>X-Foo</respect-response-cache-directive>
6868
<method>GET</method>
6969
<blacklisted-paths>@/path/not-to-be/cached@</blacklisted-paths>

0 commit comments

Comments
 (0)