InMemoryDataSourceRegistry
The default in-memory {@see DataSourceRegistryInterface}: resolves a source name by asking each {@see register()}ed {@see DataSourceInterface} (most recently registered first) whether it {@see DataSourceInterface::supports()} it.
InMemoryDataSourceRegistry::register()
public function register(Milpa\Live\Contracts\Data\DataSourceInterface $source): voidRegisters `$source`, taking precedence over any already-registered source.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | Milpa\Live\Contracts\Data\DataSourceInterface |
InMemoryDataSourceRegistry::resolve()
public function resolve(string $source): Milpa\Live\Contracts\Data\DataSourceInterfaceReturns the first registered source that {@see DataSourceInterface::supports()} `$source`.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
Throws
\RuntimeException If no registered source supports `$source`.