class YamlDiscovery in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Discovery/YamlDiscovery.php \Drupal\Core\Discovery\YamlDiscovery
- 10 core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery
- 10 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Discovery/YamlDiscovery.php \Drupal\Core\Discovery\YamlDiscovery
- 9 core/lib/Drupal/Core/Discovery/YamlDiscovery.php \Drupal\Core\Discovery\YamlDiscovery
Provides discovery for YAML files within a given set of directories.
This overrides the Component file decoding with the Core YAML implementation.
Hierarchy
- class \Drupal\Core\Discovery\YamlDiscovery extends \Drupal\Component\Discovery\YamlDiscovery
Expanded class hierarchy of YamlDiscovery
5 files declare their use of YamlDiscovery
- MigrationState.php in core/
modules/ migrate_drupal/ src/ MigrationState.php - PermissionHandler.php in core/
modules/ user/ src/ PermissionHandler.php - RouteBuilder.php in core/
lib/ Drupal/ Core/ Routing/ RouteBuilder.php - YamlDiscovery.php in core/
lib/ Drupal/ Core/ Plugin/ Discovery/ YamlDiscovery.php - YamlDiscoveryTest.php in core/
tests/ Drupal/ Tests/ Core/ Discovery/ YamlDiscoveryTest.php
File
- core/
lib/ Drupal/ Core/ Discovery/ YamlDiscovery.php, line 14
Namespace
Drupal\Core\DiscoveryView source
class YamlDiscovery extends ComponentYamlDiscovery {
/**
* {@inheritdoc}
*/
protected function decode($file) {
try {
return Yaml::decode(file_get_contents($file)) ?: [];
} catch (InvalidDataTypeException $e) {
throw new InvalidDataTypeException($file . ': ' . $e
->getMessage(), $e
->getCode(), $e);
}
}
}