X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-kernel%2FCacheWarmer%2FCacheWarmerAggregate.php;h=ca3911ed5f9dc13bfb6d3c902d62bcfcbacb00e8;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=e5f4e4fa4a2319ea242818ff38f3d00da8b9eaea;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php index e5f4e4fa4..ca3911ed5 100644 --- a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php +++ b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php @@ -15,17 +15,21 @@ namespace Symfony\Component\HttpKernel\CacheWarmer; * Aggregates several cache warmers into a single one. * * @author Fabien Potencier + * + * @final since version 3.4 */ class CacheWarmerAggregate implements CacheWarmerInterface { protected $warmers = array(); protected $optionalsEnabled = false; + private $triggerDeprecation = false; - public function __construct(array $warmers = array()) + public function __construct($warmers = array()) { foreach ($warmers as $warmer) { $this->add($warmer); } + $this->triggerDeprecation = true; } public function enableOptionalWarmers() @@ -59,16 +63,28 @@ class CacheWarmerAggregate implements CacheWarmerInterface return false; } + /** + * @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead. + */ public function setWarmers(array $warmers) { + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED); + $this->warmers = array(); foreach ($warmers as $warmer) { $this->add($warmer); } } + /** + * @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead. + */ public function add(CacheWarmerInterface $warmer) { + if ($this->triggerDeprecation) { + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED); + } + $this->warmers[] = $warmer; } }