1 | <?php |
||
28 | class Parser |
||
29 | { |
||
30 | |||
31 | /** |
||
32 | * @var \Psr\Log\LoggerInterface |
||
33 | */ |
||
34 | protected $logger; |
||
35 | |||
36 | /** |
||
37 | * @var array[FilterInterface] |
||
38 | */ |
||
39 | protected $filters = array(); |
||
40 | |||
41 | /** |
||
42 | * @var StandardAbstract |
||
43 | */ |
||
44 | protected $standard; |
||
45 | |||
46 | /** |
||
47 | * @param StandardAbstract $standard |
||
48 | * @param LoggerInterface $logger |
||
49 | */ |
||
50 | 32 | public function __construct(StandardAbstract $standard, LoggerInterface $logger) |
|
55 | |||
56 | /** |
||
57 | * @return StandardAbstract |
||
58 | */ |
||
59 | 20 | public function getStandard() |
|
63 | |||
64 | /** |
||
65 | * @param $tagName |
||
66 | * @return bool |
||
67 | */ |
||
68 | 7 | public function isItem($tagName) |
|
72 | |||
73 | /** |
||
74 | * @param FilterInterface $filter |
||
75 | * @return $this |
||
76 | */ |
||
77 | 3 | public function addFilter(FilterInterface $filter) |
|
83 | |||
84 | /** |
||
85 | * @param DOMDocument $document |
||
86 | * @param FeedInterface $feed |
||
87 | * @return \FeedIo\FeedInterface |
||
88 | * @throws Parser\MissingFieldsException |
||
89 | * @throws Parser\UnsupportedFormatException |
||
90 | */ |
||
91 | 8 | public function parse(DOMDocument $document, FeedInterface $feed) |
|
104 | |||
105 | /** |
||
106 | * @param DOMDocument $document |
||
107 | * @param array $mandatoryFields |
||
108 | * @return $this |
||
109 | * @throws MissingFieldsException |
||
110 | */ |
||
111 | 9 | public function checkBodyStructure(DOMDocument $document, array $mandatoryFields) |
|
131 | |||
132 | /** |
||
133 | * @param NodeInterface $item |
||
134 | * @param \DOMElement $element |
||
135 | * @param RuleSet $ruleSet |
||
136 | * @return NodeInterface |
||
137 | */ |
||
138 | 8 | public function parseNode(NodeInterface $item, \DOMElement $element, RuleSet $ruleSet) |
|
154 | |||
155 | /** |
||
156 | * @param FeedInterface $feed |
||
157 | * @param NodeInterface $item |
||
158 | * @return $this |
||
159 | */ |
||
160 | 6 | public function addValidItem(FeedInterface $feed, NodeInterface $item) |
|
168 | |||
169 | /** |
||
170 | * @param ItemInterface $item |
||
171 | * @return bool |
||
172 | */ |
||
173 | 8 | public function isValid(ItemInterface $item) |
|
183 | } |
||
184 |