1 | <?php |
||
22 | class Feed |
||
23 | { |
||
24 | /** |
||
25 | * @var ReaderInterface |
||
26 | */ |
||
27 | protected $reader; |
||
28 | |||
29 | /** |
||
30 | * @var EventDispatcherInterface |
||
31 | */ |
||
32 | protected $eventDispatcher; |
||
33 | |||
34 | /** |
||
35 | * @var ModifierInterface[] |
||
36 | */ |
||
37 | protected $modifiers = []; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $continues = []; |
||
43 | |||
44 | /** |
||
45 | * @param ReaderInterface $reader |
||
46 | * @param EventDispatcherInterface $eventDispatcher |
||
47 | */ |
||
48 | 38 | public function __construct(ReaderInterface $reader, EventDispatcherInterface $eventDispatcher = null) |
|
53 | |||
54 | /** |
||
55 | * @return ReaderInterface |
||
56 | */ |
||
57 | 2 | public function getReader() |
|
61 | |||
62 | /** |
||
63 | * @return EventDispatcherInterface |
||
64 | */ |
||
65 | 4 | public function getEventDispatcher() |
|
69 | |||
70 | /** |
||
71 | * @return ModifierInterface[] |
||
72 | */ |
||
73 | 16 | public function getModifiers() |
|
77 | |||
78 | /** |
||
79 | * @param FilterInterface $filter |
||
80 | * @param int|null $position |
||
81 | */ |
||
82 | 2 | public function addFilter(FilterInterface $filter, $position = null) |
|
86 | |||
87 | /** |
||
88 | * @param MapperInterface $mapper |
||
89 | * @param int|null $position |
||
90 | */ |
||
91 | 2 | public function addMapper(MapperInterface $mapper, $position = null) |
|
95 | |||
96 | /** |
||
97 | * @param TransformerInterface $transformer |
||
98 | * @param int|null $position |
||
99 | */ |
||
100 | 2 | public function addTransformer(TransformerInterface $transformer, $position = null) |
|
104 | |||
105 | /** |
||
106 | * @param ValidatorInterface $validator |
||
107 | * @param int|null $position |
||
108 | */ |
||
109 | 2 | public function addValidator(ValidatorInterface $validator, $position = null) |
|
113 | |||
114 | /** |
||
115 | * @param ModifierInterface $modifier |
||
116 | * @param int $position |
||
117 | * @param bool $continueOnException |
||
118 | * |
||
119 | * @throws \InvalidArgumentException |
||
120 | */ |
||
121 | 34 | public function addModifier(ModifierInterface $modifier, $position = null, $continueOnException = false) |
|
140 | |||
141 | /** |
||
142 | * @param ModifierInterface $modifier |
||
143 | */ |
||
144 | 2 | public function removeModifier(ModifierInterface $modifier) |
|
154 | |||
155 | /** |
||
156 | * @param int $position |
||
157 | * |
||
158 | * @throws \OutOfBoundsException |
||
159 | */ |
||
160 | 2 | public function removeModifierAt($position) |
|
168 | |||
169 | /** |
||
170 | * @param int $position |
||
171 | * |
||
172 | * @return bool |
||
173 | */ |
||
174 | 4 | public function hasModifierAt($position) |
|
178 | |||
179 | /** |
||
180 | * @return ParameterBag|null |
||
181 | */ |
||
182 | 16 | public function getNextItem() |
|
215 | |||
216 | /** |
||
217 | * @param ParameterBag $item |
||
218 | * |
||
219 | * @throws FilterException |
||
220 | * @throws ModificationException |
||
221 | * @throws ValidationException |
||
222 | * |
||
223 | * @return ParameterBag |
||
224 | */ |
||
225 | 16 | protected function modify(ParameterBag &$item) |
|
265 | } |
||
266 |