| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | abstract class ContentFilter |
||
| 15 | { |
||
| 16 | |||
| 17 | use Configurable; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Nested content filter |
||
| 21 | * |
||
| 22 | * @var ContentFilter |
||
| 23 | */ |
||
| 24 | protected $nestedContentFilter; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Cache lifetime |
||
| 28 | * |
||
| 29 | * @config |
||
| 30 | * @var int |
||
| 31 | */ |
||
| 32 | private static $cache_lifetime = 300; |
||
|
|
|||
| 33 | |||
| 34 | public function __construct($nestedContentFilter = null) |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Gets the cache to use |
||
| 41 | * |
||
| 42 | * @return CacheInterface |
||
| 43 | */ |
||
| 44 | protected function getCache() |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Evaluates the result of the given callback |
||
| 53 | * |
||
| 54 | * @param string $key Unique key for this |
||
| 55 | * @param callable $callback Callback for evaluating the content |
||
| 56 | * @return mixed Result of $callback() |
||
| 57 | */ |
||
| 58 | public function getContent($key, $callback) |
||
| 67 |