3 namespace Drupal\Core\Config\Schema;
5 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
6 use Drupal\Component\Plugin\Discovery\DiscoveryTrait;
7 use Drupal\Core\Config\StorageInterface;
10 * Allows YAML files to define config schema types.
12 class ConfigSchemaDiscovery implements DiscoveryInterface {
17 * A storage instance for reading configuration schema data.
19 * @var \Drupal\Core\Config\StorageInterface
21 protected $schemaStorage;
24 * Constructs a ConfigSchemaDiscovery object.
26 * @param $schema_storage
27 * The storage object to use for reading schema data.
29 public function __construct(StorageInterface $schema_storage) {
30 $this->schemaStorage = $schema_storage;
36 public function getDefinitions() {
38 foreach ($this->schemaStorage->readMultiple($this->schemaStorage->listAll()) as $schema) {
39 foreach ($schema as $type => $definition) {
40 $definitions[$type] = $definition;