| 1 | <?php |
||
| 18 | class Registry |
||
| 19 | { |
||
| 20 | /** @var array */ |
||
| 21 | public $sources = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Adds a proxy source to the registry. |
||
| 25 | * |
||
| 26 | * @param SourceInterface $source The source to be registered. |
||
| 27 | * @param string $alias The identifier the source shall be find by. |
||
| 28 | * |
||
| 29 | * @return Registry |
||
| 30 | */ |
||
| 31 | public function add(SourceInterface $source, $alias) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Finds the source identified by the given id in the registry; |
||
| 40 | * |
||
| 41 | * @param string $name Identifier of the source to be returned. |
||
| 42 | * |
||
| 43 | * @return SourceInterface |
||
| 44 | */ |
||
| 45 | public function get($name) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Indicates if the given name represents a registered source. |
||
| 56 | * |
||
| 57 | * @param string $name |
||
| 58 | * |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | public function has($name) |
||
| 65 | } |
||
| 66 |