Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Plugin/DefaultPluginManager.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 | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\Core\Plugin; | 3 namespace Drupal\Core\Plugin; |
4 | 4 |
5 use Drupal\Component\Assertion\Inspector; | |
5 use Drupal\Component\Plugin\Definition\PluginDefinitionInterface; | 6 use Drupal\Component\Plugin\Definition\PluginDefinitionInterface; |
6 use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface; | 7 use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface; |
7 use Drupal\Core\Cache\CacheableDependencyInterface; | 8 use Drupal\Core\Cache\CacheableDependencyInterface; |
8 use Drupal\Core\Cache\CacheBackendInterface; | 9 use Drupal\Core\Cache\CacheBackendInterface; |
9 use Drupal\Core\Cache\UseCacheBackendTrait; | 10 use Drupal\Core\Cache\UseCacheBackendTrait; |
146 * definitions of a plugin manager, call that plugin manager's | 147 * definitions of a plugin manager, call that plugin manager's |
147 * clearCachedDefinitions() method. Only use cache tags when cached plugin | 148 * clearCachedDefinitions() method. Only use cache tags when cached plugin |
148 * definitions should be cleared along with other, related cache entries. | 149 * definitions should be cleared along with other, related cache entries. |
149 */ | 150 */ |
150 public function setCacheBackend(CacheBackendInterface $cache_backend, $cache_key, array $cache_tags = []) { | 151 public function setCacheBackend(CacheBackendInterface $cache_backend, $cache_key, array $cache_tags = []) { |
151 assert('\Drupal\Component\Assertion\Inspector::assertAllStrings($cache_tags)', 'Cache Tags must be strings.'); | 152 assert(Inspector::assertAllStrings($cache_tags), 'Cache Tags must be strings.'); |
152 $this->cacheBackend = $cache_backend; | 153 $this->cacheBackend = $cache_backend; |
153 $this->cacheKey = $cache_key; | 154 $this->cacheKey = $cache_key; |
154 $this->cacheTags = $cache_tags; | 155 $this->cacheTags = $cache_tags; |
155 } | 156 } |
156 | 157 |
157 /** | 158 /** |
158 * Initializes the alter hook. | 159 * Sets the alter hook name. |
159 * | 160 * |
160 * @param string $alter_hook | 161 * @param string $alter_hook |
161 * Name of the alter hook; for example, to invoke | 162 * Name of the alter hook; for example, to invoke |
162 * hook_mymodule_data_alter() pass in "mymodule_data". | 163 * hook_mymodule_data_alter() pass in "mymodule_data". |
163 */ | 164 */ |