1 | <?php |
||
21 | abstract class XmlAbstract extends StandardAbstract |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Name of the node containing all the feed's items |
||
26 | */ |
||
27 | const ITEM_NODE = 'item'; |
||
28 | |||
29 | /** |
||
30 | * This is for XML Standards |
||
31 | */ |
||
32 | const SYNTAX_FORMAT = 'Xml'; |
||
33 | |||
34 | /** |
||
35 | * RuleSet used to parse the feed's main node |
||
36 | * @var \FeedIo\RuleSet |
||
37 | */ |
||
38 | protected $feedRuleSet; |
||
39 | |||
40 | /** |
||
41 | * @var \FeedIo\RuleSet |
||
42 | */ |
||
43 | protected $itemRuleSet; |
||
44 | |||
45 | /** |
||
46 | * Formats the document according to the standard's specification |
||
47 | * @param \DOMDocument $document |
||
48 | * @return mixed |
||
49 | */ |
||
50 | abstract public function format(\DOMDocument $document); |
||
51 | |||
52 | /** |
||
53 | * @param \DOMDocument $document |
||
54 | * @return \DomElement |
||
55 | */ |
||
56 | abstract public function getMainElement(\DOMDocument $document); |
||
57 | |||
58 | /** |
||
59 | * Builds and returns a rule set to parse the root node |
||
60 | * @return \FeedIo\RuleSet |
||
61 | */ |
||
62 | abstract public function buildFeedRuleSet(); |
||
63 | |||
64 | /** |
||
65 | * Builds and returns a rule set to parse an item |
||
66 | * @return \FeedIo\RuleSet |
||
67 | */ |
||
68 | abstract public function buildItemRuleSet(); |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | 11 | public function getItemNodeName() |
|
77 | |||
78 | /** |
||
79 | * @return XmlParser |
||
80 | */ |
||
81 | public function newParser() |
||
85 | |||
86 | /** |
||
87 | * Returns the RuleSet used to parse the feed's main node |
||
88 | * @return \FeedIo\RuleSet |
||
89 | */ |
||
90 | 12 | public function getFeedRuleSet() |
|
98 | |||
99 | /** |
||
100 | * @return \FeedIo\RuleSet |
||
101 | */ |
||
102 | 10 | public function getItemRuleSet() |
|
110 | |||
111 | /** |
||
112 | * @param string $tagName |
||
113 | * @return ModifiedSince |
||
114 | */ |
||
115 | 14 | public function getModifiedSinceRule($tagName) |
|
123 | |||
124 | /** |
||
125 | * @return RuleSet |
||
126 | */ |
||
127 | 14 | protected function buildBaseRuleSet() |
|
134 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: