Skip to content

Commit d72c648

Browse files
committed
Remove return types from XMLWriter stubs
These break BC, and as such we have to stick with docblock annotations. Closes phpGH-6319.
1 parent 63289cf commit d72c648

File tree

3 files changed

+277
-148
lines changed

3 files changed

+277
-148
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ PHP NEWS
2727
. Fixed bug #64060 (lstat_stat_variation7.phpt fails on certain file systems).
2828
(M. Voelker, cmb)
2929

30+
- XMLWriter:
31+
. Removed return types from XMLWriter stubs. (cmb)
32+
3033
01 Oct 2020, PHP 8.0.0rc1
3134

3235
- CLI:

ext/xmlwriter/php_xmlwriter.stub.php

Lines changed: 251 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -88,129 +88,255 @@ function xmlwriter_flush(XMLWriter $writer, bool $empty = true): string|int {}
8888

8989
class XMLWriter
9090
{
91-
/** @alias xmlwriter_open_uri */
92-
public function openUri(string $uri): bool {}
93-
94-
/** @alias xmlwriter_open_memory */
95-
public function openMemory(): bool {}
96-
97-
/** @alias xmlwriter_set_indent */
98-
public function setIndent(bool $enable): bool {}
99-
100-
/** @alias xmlwriter_set_indent_string */
101-
public function setIndentString(string $indentation): bool {}
102-
103-
/** @alias xmlwriter_start_comment */
104-
public function startComment(): bool {}
105-
106-
/** @alias xmlwriter_end_comment */
107-
public function endComment(): bool {}
108-
109-
/** @alias xmlwriter_start_attribute */
110-
public function startAttribute(string $name): bool {}
111-
112-
/** @alias xmlwriter_end_attribute */
113-
public function endAttribute(): bool {}
114-
115-
/** @alias xmlwriter_write_attribute */
116-
public function writeAttribute(string $name, string $value): bool {}
117-
118-
/** @alias xmlwriter_start_attribute_ns */
119-
public function startAttributeNs(?string $prefix, string $name, ?string $namespace): bool {}
120-
121-
/** @alias xmlwriter_write_attribute_ns */
122-
public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value): bool {}
123-
124-
/** @alias xmlwriter_start_element */
125-
public function startElement(string $name): bool {}
126-
127-
/** @alias xmlwriter_end_element */
128-
public function endElement(): bool {}
129-
130-
/** @alias xmlwriter_full_end_element */
131-
public function fullEndElement(): bool {}
132-
133-
/** @alias xmlwriter_start_element_ns */
134-
public function startElementNs(?string $prefix, string $name, ?string $namespace): bool {}
135-
136-
/** @alias xmlwriter_write_element */
137-
public function writeElement(string $name, ?string $content = null): bool {}
138-
139-
/** @alias xmlwriter_write_element_ns */
140-
public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {}
141-
142-
/** @alias xmlwriter_start_pi */
143-
public function startPi(string $target): bool {}
144-
145-
/** @alias xmlwriter_end_pi */
146-
public function endPi(): bool {}
147-
148-
/** @alias xmlwriter_write_pi */
149-
public function writePi(string $target, string $content): bool {}
150-
151-
/** @alias xmlwriter_start_cdata */
152-
public function startCdata(): bool {}
153-
154-
/** @alias xmlwriter_end_cdata */
155-
public function endCdata(): bool {}
156-
157-
/** @alias xmlwriter_write_cdata */
158-
public function writeCdata(string $content): bool {}
159-
160-
/** @alias xmlwriter_text */
161-
public function text(string $content): bool {}
162-
163-
/** @alias xmlwriter_write_raw */
164-
public function writeRaw(string $content): bool {}
165-
166-
/** @alias xmlwriter_start_document */
167-
public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}
168-
169-
/** @alias xmlwriter_end_document */
170-
public function endDocument(): bool {}
171-
172-
/** @alias xmlwriter_write_comment */
173-
public function writeComment(string $content): bool {}
174-
175-
/** @alias xmlwriter_start_dtd */
176-
public function startDtd(string $qualifiedName, ?string $publicId = null, ?string $systemId = null): bool {}
177-
178-
/** @alias xmlwriter_end_dtd */
179-
public function endDtd(): bool {}
180-
181-
/** @alias xmlwriter_write_dtd */
182-
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null): bool {}
183-
184-
/** @alias xmlwriter_start_dtd_element */
185-
public function startDtdElement(string $qualifiedName): bool {}
186-
187-
/** @alias xmlwriter_end_dtd_element */
188-
public function endDtdElement(): bool {}
189-
190-
/** @alias xmlwriter_write_dtd_element */
191-
public function writeDtdElement(string $name, string $content): bool {}
192-
193-
/** @alias xmlwriter_start_dtd_attlist */
194-
public function startDtdAttlist(string $name): bool {}
195-
196-
/** @alias xmlwriter_end_dtd_attlist */
197-
public function endDtdAttlist(): bool {}
198-
199-
/** @alias xmlwriter_write_dtd_attlist */
200-
public function writeDtdAttlist(string $name, string $content): bool {}
201-
202-
/** @alias xmlwriter_start_dtd_entity */
203-
public function startDtdEntity(string $name, bool $isParam): bool {}
204-
205-
/** @alias xmlwriter_end_dtd_entity */
206-
public function endDtdEntity(): bool {}
207-
208-
/** @alias xmlwriter_write_dtd_entity */
209-
public function writeDtdEntity(string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null): bool {}
210-
211-
/** @alias xmlwriter_output_memory */
212-
public function outputMemory(bool $flush = true): string {}
213-
214-
/** @alias xmlwriter_flush */
215-
public function flush(bool $empty = true): string|int {}
91+
/**
92+
* @return bool
93+
* @alias xmlwriter_open_uri
94+
*/
95+
public function openUri(string $uri) {}
96+
97+
/**
98+
* @return bool
99+
* @alias xmlwriter_open_memory
100+
*/
101+
public function openMemory() {}
102+
103+
/**
104+
* @return bool
105+
* @alias xmlwriter_set_indent
106+
*/
107+
public function setIndent(bool $enable) {}
108+
109+
/**
110+
* @return bool
111+
* @alias xmlwriter_set_indent_string
112+
*/
113+
public function setIndentString(string $indentation) {}
114+
115+
/**
116+
* @return bool
117+
* @alias xmlwriter_start_comment
118+
*/
119+
public function startComment() {}
120+
121+
/**
122+
* @return bool
123+
* @alias xmlwriter_end_comment
124+
*/
125+
public function endComment() {}
126+
127+
/**
128+
* @return bool
129+
* @alias xmlwriter_start_attribute
130+
*/
131+
public function startAttribute(string $name) {}
132+
133+
/**
134+
* @return bool
135+
* @alias xmlwriter_end_attribute
136+
*/
137+
public function endAttribute() {}
138+
139+
/**
140+
* @return bool
141+
* @alias xmlwriter_write_attribute
142+
*/
143+
public function writeAttribute(string $name, string $value) {}
144+
145+
/**
146+
* @return bool
147+
* @alias xmlwriter_start_attribute_ns
148+
*/
149+
public function startAttributeNs(?string $prefix, string $name, ?string $namespace) {}
150+
151+
/**
152+
* @return bool
153+
* @alias xmlwriter_write_attribute_ns
154+
*/
155+
public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value) {}
156+
157+
/**
158+
* @return bool
159+
* @alias xmlwriter_start_element
160+
*/
161+
public function startElement(string $name) {}
162+
163+
/**
164+
* @return bool
165+
* @alias xmlwriter_end_element
166+
*/
167+
public function endElement() {}
168+
169+
/**
170+
* @return bool
171+
* @alias xmlwriter_full_end_element
172+
*/
173+
public function fullEndElement() {}
174+
175+
/**
176+
* @return bool
177+
* @alias xmlwriter_start_element_ns
178+
*/
179+
public function startElementNs(?string $prefix, string $name, ?string $namespace) {}
180+
181+
/**
182+
* @return bool
183+
* @alias xmlwriter_write_element
184+
*/
185+
public function writeElement(string $name, ?string $content = null) {}
186+
187+
/**
188+
* @return bool
189+
* @alias xmlwriter_write_element_ns
190+
*/
191+
public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null) {}
192+
193+
/**
194+
* @return bool
195+
* @alias xmlwriter_start_pi
196+
*/
197+
public function startPi(string $target) {}
198+
199+
/**
200+
* @return bool
201+
* @alias xmlwriter_end_pi
202+
*/
203+
public function endPi() {}
204+
205+
/**
206+
* @return bool
207+
* @alias xmlwriter_write_pi
208+
*/
209+
public function writePi(string $target, string $content) {}
210+
211+
/**
212+
* @return bool
213+
* @alias xmlwriter_start_cdata
214+
*/
215+
public function startCdata() {}
216+
217+
/**
218+
* @return bool
219+
* @alias xmlwriter_end_cdata
220+
* */
221+
public function endCdata() {}
222+
223+
/**
224+
* @return bool
225+
* @alias xmlwriter_write_cdata
226+
*/
227+
public function writeCdata(string $content) {}
228+
229+
/**
230+
* @return bool
231+
* @alias xmlwriter_text
232+
*/
233+
public function text(string $content) {}
234+
235+
/**
236+
* @return bool
237+
* @alias xmlwriter_write_raw
238+
*/
239+
public function writeRaw(string $content) {}
240+
241+
/**
242+
* @return bool
243+
* @alias xmlwriter_start_document
244+
*/
245+
public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null) {}
246+
247+
/**
248+
* @return bool
249+
* @alias xmlwriter_end_document
250+
*/
251+
public function endDocument() {}
252+
253+
/**
254+
* @return bool
255+
* @alias xmlwriter_write_comment
256+
*/
257+
public function writeComment(string $content) {}
258+
259+
/**
260+
* @return bool
261+
* @alias xmlwriter_start_dtd
262+
*/
263+
public function startDtd(string $qualifiedName, ?string $publicId = null, ?string $systemId = null) {}
264+
265+
/**
266+
* @return bool
267+
* @alias xmlwriter_end_dtd
268+
*/
269+
public function endDtd() {}
270+
271+
/**
272+
* @return bool
273+
* @alias xmlwriter_write_dtd
274+
*/
275+
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null) {}
276+
277+
/**
278+
* @return bool
279+
* @alias xmlwriter_start_dtd_element
280+
*/
281+
public function startDtdElement(string $qualifiedName) {}
282+
283+
/**
284+
* @return bool
285+
* @alias xmlwriter_end_dtd_element
286+
*/
287+
public function endDtdElement() {}
288+
289+
/**
290+
* @return bool
291+
* @alias xmlwriter_write_dtd_element
292+
*/
293+
public function writeDtdElement(string $name, string $content) {}
294+
295+
/**
296+
* @return bool
297+
* @alias xmlwriter_start_dtd_attlist
298+
*/
299+
public function startDtdAttlist(string $name) {}
300+
301+
/**
302+
* @return bool
303+
* @alias xmlwriter_end_dtd_attlist
304+
*/
305+
public function endDtdAttlist() {}
306+
307+
/**
308+
* @return bool
309+
* @alias xmlwriter_write_dtd_attlist
310+
*/
311+
public function writeDtdAttlist(string $name, string $content) {}
312+
313+
/**
314+
* @return bool
315+
* @alias xmlwriter_start_dtd_entity
316+
*/
317+
public function startDtdEntity(string $name, bool $isParam) {}
318+
319+
/**
320+
* @return bool
321+
* @alias xmlwriter_end_dtd_entity
322+
*/
323+
public function endDtdEntity() {}
324+
325+
/**
326+
* @return bool
327+
* @alias xmlwriter_write_dtd_entity
328+
*/
329+
public function writeDtdEntity(string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null) {}
330+
331+
/**
332+
* @return string
333+
* @alias xmlwriter_output_memory
334+
*/
335+
public function outputMemory(bool $flush = true) {}
336+
337+
/**
338+
* @return string|int
339+
* @alias xmlwriter_flush
340+
*/
341+
public function flush(bool $empty = true) {}
216342
}

0 commit comments

Comments
 (0)