Same filename and directory in other branches
- 9 core/modules/system/tests/modules/module_test/src/PluginManagerCacheClearer.php
Namespace
Drupal\module_test
File
core/modules/system/tests/modules/module_test/src/PluginManagerCacheClearer.php
View source
<?php
namespace Drupal\module_test;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\State\StateInterface;
class PluginManagerCacheClearer extends DefaultPluginManager {
protected $state;
protected $optionalService;
public function __construct(StateInterface $state, $optional_service = NULL) {
$this->state = $state;
$this->optionalService = $optional_service;
}
public function clearCachedDefinitions() {
$this->state
->set(self::class, isset($this->optionalService));
}
}
Classes