diff vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php	Mon Apr 23 09:46:53 2018 +0100
@@ -15,17 +15,21 @@
  * Aggregates several cache warmers into a single one.
  *
  * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @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 @@
         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;
     }
 }