Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 6 |
CachedDiscoveryClearer | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 6 |
addCachedDiscovery | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
clearCachedDefinitions | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 4 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\Core\Plugin\CachedDiscoveryClearer. | |
*/ | |
namespace Drupal\Core\Plugin; | |
use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface; | |
/** | |
* Defines a class which is capable of clearing the cache on plugin managers. | |
*/ | |
class CachedDiscoveryClearer implements CachedDiscoveryClearerInterface { | |
/** | |
* The stored discoveries. | |
* | |
* @var \Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface[] | |
*/ | |
protected $cachedDiscoveries = array(); | |
/** | |
* {@inheritdoc} | |
*/ | |
public function addCachedDiscovery(CachedDiscoveryInterface $cached_discovery) { | |
$this->cachedDiscoveries[] = $cached_discovery; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function clearCachedDefinitions() { | |
foreach ($this->cachedDiscoveries as $cached_discovery) { | |
$cached_discovery->clearCachedDefinitions(); | |
} | |
} | |
} |