1 | <?php |
||
24 | final class SourcesRegistry implements SourcesRegistryInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var SourceInterface[] |
||
28 | */ |
||
29 | private $sources; |
||
30 | |||
31 | 10 | public function __construct(array $sources = array()) |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 10 | public function add(SourceInterface $source) |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 10 | public function has($name) |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | * |
||
63 | * @throws SourceNotAvailableException |
||
64 | */ |
||
65 | 4 | public function get($name) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 4 | public function all(array $filter = array()) |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 2 | public function getIterator() |
|
93 | |||
94 | /** |
||
95 | * Filter sources. |
||
96 | * |
||
97 | * Available filter criteria: |
||
98 | * * name: string |
||
99 | * * names: string[] |
||
100 | * |
||
101 | * @param SourceInterface[] $sources Sources to filter. |
||
102 | * @param array $filters Filter criteria. |
||
103 | * |
||
104 | * @return SourceInterface[] |
||
105 | */ |
||
106 | 2 | private function filter($sources, array $filters = array()) |
|
119 | } |
||
120 |