Skip to content

Commit 53dcab2

Browse files
Jean-Berudbu
andauthored
Apply suggestions from code review
Co-authored-by: David Buchmann <[email protected]>
1 parent add12ba commit 53dcab2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Resources/doc/reference/configuration/proxy-client.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ endpoint for testing purposes.
278278

279279
cloudfront
280280
----------
281+
Talking to AWS cloudfront requires the ``jean-beru/fos-http-cache-cloudfront`` library. You need to require this dependency before you can configure the ``cloudfront`` proxy client.
281282

282283
.. code-block:: yaml
283284

src/DependencyInjection/Configuration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ private function addProxyClientSection(ArrayNodeDefinition $rootNode)
496496
->end()
497497

498498
->arrayNode('cloudfront')
499+
->info('Configure a client to interact with AWS cloudfront. You need to install jean-beru/fos-http-cache-cloudfront to work with cloudfront')
499500
->children()
500501
->scalarNode('distribution_id')
501502
->info('Identifier for your CloudFront distribution you want to purge the cache for')
@@ -511,7 +512,7 @@ private function addProxyClientSection(ArrayNodeDefinition $rootNode)
511512
->end()
512513
->validate()
513514
->ifTrue(function ($v) {
514-
return !empty($v['client']) && !empty($v['configuration']);
515+
return null !== $v['client'] && count($v['configuration']) > 0;
515516
})
516517
->thenInvalid('You can not set both cloudfront.client and cloudfront.configuration')
517518
->end()
@@ -551,7 +552,7 @@ private function addProxyClientSection(ArrayNodeDefinition $rootNode)
551552

552553
if ('cloudfront' === $proxyName) {
553554
if (!class_exists(CloudFront::class)) {
554-
throw new InvalidConfigurationException('Did you forget to install jean-beru/fos-http-cache-cloudfront ?');
555+
throw new InvalidConfigurationException('For the cloudfront proxy client, you need to install jean-beru/fos-http-cache-cloudfront. Class '.CloudFront::class.' does not exist.');
555556
}
556557
}
557558
}

0 commit comments

Comments
 (0)