| Total Complexity | 4 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | trait MetadataLoaderAwareTrait |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Store the metadata loader. |
||
| 19 | * |
||
| 20 | * @var MetadataLoader |
||
| 21 | */ |
||
| 22 | protected $metadataLoader; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Set a metadata loader. |
||
| 26 | * |
||
| 27 | * @param MetadataLoader $loader The metadata loader. |
||
| 28 | * @return void |
||
| 29 | */ |
||
| 30 | protected function setMetadataLoader(MetadataLoader $loader) |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Retrieve the metadata loader. |
||
| 37 | * |
||
| 38 | * @throws RuntimeException If the metadata loader is missing. |
||
| 39 | * @return MetadataLoader |
||
| 40 | */ |
||
| 41 | public function metadataLoader() |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Load a metadata file. |
||
| 55 | * |
||
| 56 | * @param string $metadataIdent A metadata file path or namespace. |
||
| 57 | * @return MetadataInterface |
||
| 58 | */ |
||
| 59 | protected function loadMetadata($metadataIdent) |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Retrieve a new metadata object. |
||
| 69 | * |
||
| 70 | * @return MetadataInterface |
||
| 71 | */ |
||
| 72 | abstract protected function createMetadata(); |
||
| 73 | } |
||
| 74 |