1<?php 2 3/* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <fabien@symfony.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Symfony\Component\Cache\Traits; 13 14use Symfony\Component\Cache\PruneableInterface; 15use Symfony\Contracts\Service\ResetInterface; 16 17/** 18 * @author Nicolas Grekas <p@tchwork.com> 19 * 20 * @internal 21 */ 22trait ProxyTrait 23{ 24 private $pool; 25 26 /** 27 * {@inheritdoc} 28 */ 29 public function prune() 30 { 31 return $this->pool instanceof PruneableInterface && $this->pool->prune(); 32 } 33 34 /** 35 * {@inheritdoc} 36 */ 37 public function reset() 38 { 39 if ($this->pool instanceof ResetInterface) { 40 $this->pool->reset(); 41 } 42 } 43} 44