1 | <?php |
||
15 | abstract class PHP extends Renderer |
||
16 | { |
||
17 | /** |
||
18 | * @var array[] List of dictionaries used by the Quick renderer [[attrName => attrValue]] |
||
19 | */ |
||
20 | protected $attributes; |
||
21 | |||
22 | /** |
||
23 | * @var array Dictionary of replacements used by the Quick renderer [id => [match, replace]] |
||
24 | */ |
||
25 | protected $dynamic; |
||
26 | |||
27 | /** |
||
28 | * @var bool Whether to enable the Quick renderer |
||
29 | */ |
||
30 | public $enableQuickRenderer = false; |
||
31 | |||
32 | /** |
||
33 | * @var string Renderer's output |
||
34 | */ |
||
35 | protected $out; |
||
36 | |||
37 | /** |
||
38 | * @var array Branching table used by the Quick renderer [id => index] |
||
39 | */ |
||
40 | protected $quickBranches; |
||
41 | |||
42 | /** |
||
43 | * @var string Regexp that matches XML elements to be rendered by the quick renderer |
||
44 | */ |
||
45 | protected $quickRegexp = '((?!))'; |
||
46 | |||
47 | /** |
||
48 | * @var string Regexp that matches nodes that SHOULD NOT be rendered by the quick renderer |
||
49 | */ |
||
50 | protected $quickRenderingTest = '(<[!?])'; |
||
51 | |||
52 | /** |
||
53 | * @var array Dictionary of static replacements used by the Quick renderer [id => replacement] |
||
54 | */ |
||
55 | protected $static; |
||
56 | |||
57 | /** |
||
58 | * @var DOMXPath XPath object used to query the document being rendered |
||
59 | */ |
||
60 | protected $xpath; |
||
61 | |||
62 | /** |
||
63 | * Render given DOMNode |
||
64 | * |
||
65 | * @param DOMNode $node |
||
66 | * @return void |
||
67 | */ |
||
68 | abstract protected function renderNode(DOMNode $node); |
||
69 | |||
70 | 1 | public function __sleep() |
|
83 | |||
84 | /** |
||
85 | * Render the content of given node |
||
86 | * |
||
87 | * Matches the behaviour of an xsl:apply-templates element |
||
88 | * |
||
89 | * @param DOMNode $root Context node |
||
90 | * @param string $query XPath query used to filter which child nodes to render |
||
91 | * @return void |
||
92 | */ |
||
93 | 346 | protected function at(DOMNode $root, $query = null) |
|
109 | |||
110 | /** |
||
111 | * Test whether given XML can be rendered with the Quick renderer |
||
112 | * |
||
113 | * @param string $xml |
||
114 | * @return bool |
||
115 | */ |
||
116 | 756 | protected function canQuickRender($xml) |
|
120 | |||
121 | /** |
||
122 | * Extract the text content from given XML |
||
123 | * |
||
124 | * NOTE: numeric character entities are decoded beforehand, we don't need to decode them here |
||
125 | * |
||
126 | * @param string $xml Original XML |
||
127 | * @return string Text content, with special characters decoded |
||
128 | */ |
||
129 | 24 | protected function getQuickTextContent($xml) |
|
133 | |||
134 | /** |
||
135 | * Test whether given array has any non-null values |
||
136 | * |
||
137 | * @param array $array |
||
138 | * @return bool |
||
139 | */ |
||
140 | 4 | protected function hasNonNullValues(array $array) |
|
152 | |||
153 | /** |
||
154 | * Capture and return the attributes of an XML element |
||
155 | * |
||
156 | * NOTE: XML character entities are left as-is |
||
157 | * |
||
158 | * @param string $xml Element in XML form |
||
159 | * @return array Dictionary of [attrName => attrValue] |
||
160 | */ |
||
161 | 245 | protected function matchAttributes($xml) |
|
173 | |||
174 | /** |
||
175 | * Render an intermediate representation using the Quick renderer |
||
176 | * |
||
177 | * @param string $xml Intermediate representation |
||
178 | * @return void |
||
179 | */ |
||
180 | 406 | protected function renderQuick($xml) |
|
196 | |||
197 | /** |
||
198 | * Render a string matched by the Quick renderer |
||
199 | * |
||
200 | * This stub should be overwritten by generated renderers |
||
201 | * |
||
202 | * @param string[] $m |
||
203 | * @return void |
||
204 | */ |
||
205 | 402 | protected function renderQuickCallback(array $m) |
|
228 | |||
229 | /** |
||
230 | * Render a self-closing tag using the Quick renderer |
||
231 | * |
||
232 | * @param string[] $m |
||
233 | * @return string |
||
234 | */ |
||
235 | 61 | protected function renderQuickSelfClosingTag(array $m) |
|
248 | |||
249 | /** |
||
250 | * Render a string matched by the Quick renderer using a generated PHP template |
||
251 | * |
||
252 | * This stub should be overwritten by generated renderers |
||
253 | * |
||
254 | * @param integer $qb Template's index in the quick branch table |
||
255 | * @param string $xml |
||
256 | * @return string |
||
257 | */ |
||
258 | protected function renderQuickTemplate($qb, $xml) |
||
262 | |||
263 | /** |
||
264 | * {@inheritdoc} |
||
265 | */ |
||
266 | 756 | protected function renderRichText($xml) |
|
288 | |||
289 | /** |
||
290 | * Reset object properties that are populated during rendering |
||
291 | * |
||
292 | * @return void |
||
293 | */ |
||
294 | 347 | protected function reset() |
|
300 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.