Skip to content

Commit 6599500

Browse files
committed
Declare tentative return types for ext/xmlwriter
Relates to GH-6995
1 parent a902622 commit 6599500

File tree

2 files changed

+107
-107
lines changed

2 files changed

+107
-107
lines changed

ext/xmlwriter/php_xmlwriter.stub.php

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -89,256 +89,256 @@ function xmlwriter_flush(XMLWriter $writer, bool $empty = true): string|int {}
8989
class XMLWriter
9090
{
9191
/**
92-
* @return bool
92+
* @tentative-return-type
9393
* @alias xmlwriter_open_uri
9494
* @no-verify Behaviour differs from the aliased function
9595
*/
96-
public function openUri(string $uri) {}
96+
public function openUri(string $uri): bool {}
9797

9898
/**
99-
* @return bool
99+
* @tentative-return-type
100100
* @alias xmlwriter_open_memory
101101
* @no-verify Behaviour differs from the aliased function
102102
*/
103-
public function openMemory() {}
103+
public function openMemory(): bool {}
104104

105105
/**
106-
* @return bool
106+
* @tentative-return-type
107107
* @alias xmlwriter_set_indent
108108
*/
109-
public function setIndent(bool $enable) {}
109+
public function setIndent(bool $enable): bool {}
110110

111111
/**
112-
* @return bool
112+
* @tentative-return-type
113113
* @alias xmlwriter_set_indent_string
114114
*/
115-
public function setIndentString(string $indentation) {}
115+
public function setIndentString(string $indentation): bool {}
116116

117117
/**
118-
* @return bool
118+
* @tentative-return-type
119119
* @alias xmlwriter_start_comment
120120
*/
121-
public function startComment() {}
121+
public function startComment(): bool {}
122122

123123
/**
124-
* @return bool
124+
* @tentative-return-type
125125
* @alias xmlwriter_end_comment
126126
*/
127-
public function endComment() {}
127+
public function endComment(): bool {}
128128

129129
/**
130-
* @return bool
130+
* @tentative-return-type
131131
* @alias xmlwriter_start_attribute
132132
*/
133-
public function startAttribute(string $name) {}
133+
public function startAttribute(string $name): bool {}
134134

135135
/**
136-
* @return bool
136+
* @tentative-return-type
137137
* @alias xmlwriter_end_attribute
138138
*/
139-
public function endAttribute() {}
139+
public function endAttribute(): bool {}
140140

141141
/**
142-
* @return bool
142+
* @tentative-return-type
143143
* @alias xmlwriter_write_attribute
144144
*/
145-
public function writeAttribute(string $name, string $value) {}
145+
public function writeAttribute(string $name, string $value): bool {}
146146

147147
/**
148-
* @return bool
148+
* @tentative-return-type
149149
* @alias xmlwriter_start_attribute_ns
150150
*/
151-
public function startAttributeNs(?string $prefix, string $name, ?string $namespace) {}
151+
public function startAttributeNs(?string $prefix, string $name, ?string $namespace): bool {}
152152

153153
/**
154-
* @return bool
154+
* @tentative-return-type
155155
* @alias xmlwriter_write_attribute_ns
156156
*/
157-
public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value) {}
157+
public function writeAttributeNs(?string $prefix, string $name, ?string $namespace, string $value): bool {}
158158

159159
/**
160-
* @return bool
160+
* @tentative-return-type
161161
* @alias xmlwriter_start_element
162162
*/
163-
public function startElement(string $name) {}
163+
public function startElement(string $name): bool {}
164164

165165
/**
166-
* @return bool
166+
* @tentative-return-type
167167
* @alias xmlwriter_end_element
168168
*/
169-
public function endElement() {}
169+
public function endElement(): bool {}
170170

171171
/**
172-
* @return bool
172+
* @tentative-return-type
173173
* @alias xmlwriter_full_end_element
174174
*/
175-
public function fullEndElement() {}
175+
public function fullEndElement(): bool {}
176176

177177
/**
178-
* @return bool
178+
* @tentative-return-type
179179
* @alias xmlwriter_start_element_ns
180180
*/
181-
public function startElementNs(?string $prefix, string $name, ?string $namespace) {}
181+
public function startElementNs(?string $prefix, string $name, ?string $namespace): bool {}
182182

183183
/**
184-
* @return bool
184+
* @tentative-return-type
185185
* @alias xmlwriter_write_element
186186
*/
187-
public function writeElement(string $name, ?string $content = null) {}
187+
public function writeElement(string $name, ?string $content = null): bool {}
188188

189189
/**
190-
* @return bool
190+
* @tentative-return-type
191191
* @alias xmlwriter_write_element_ns
192192
*/
193-
public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null) {}
193+
public function writeElementNs(?string $prefix, string $name, ?string $namespace, ?string $content = null): bool {}
194194

195195
/**
196-
* @return bool
196+
* @tentative-return-type
197197
* @alias xmlwriter_start_pi
198198
*/
199-
public function startPi(string $target) {}
199+
public function startPi(string $target): bool {}
200200

201201
/**
202-
* @return bool
202+
* @tentative-return-type
203203
* @alias xmlwriter_end_pi
204204
*/
205-
public function endPi() {}
205+
public function endPi(): bool {}
206206

207207
/**
208-
* @return bool
208+
* @tentative-return-type
209209
* @alias xmlwriter_write_pi
210210
*/
211-
public function writePi(string $target, string $content) {}
211+
public function writePi(string $target, string $content): bool {}
212212

213213
/**
214-
* @return bool
214+
* @tentative-return-type
215215
* @alias xmlwriter_start_cdata
216216
*/
217-
public function startCdata() {}
217+
public function startCdata(): bool {}
218218

219219
/**
220-
* @return bool
220+
* @tentative-return-type
221221
* @alias xmlwriter_end_cdata
222222
* */
223-
public function endCdata() {}
223+
public function endCdata(): bool {}
224224

225225
/**
226-
* @return bool
226+
* @tentative-return-type
227227
* @alias xmlwriter_write_cdata
228228
*/
229-
public function writeCdata(string $content) {}
229+
public function writeCdata(string $content): bool {}
230230

231231
/**
232-
* @return bool
232+
* @tentative-return-type
233233
* @alias xmlwriter_text
234234
*/
235-
public function text(string $content) {}
235+
public function text(string $content): bool {}
236236

237237
/**
238-
* @return bool
238+
* @tentative-return-type
239239
* @alias xmlwriter_write_raw
240240
*/
241-
public function writeRaw(string $content) {}
241+
public function writeRaw(string $content): bool {}
242242

243243
/**
244-
* @return bool
244+
* @tentative-return-type
245245
* @alias xmlwriter_start_document
246246
*/
247-
public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null) {}
247+
public function startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}
248248

249249
/**
250-
* @return bool
250+
* @tentative-return-type
251251
* @alias xmlwriter_end_document
252252
*/
253-
public function endDocument() {}
253+
public function endDocument(): bool {}
254254

255255
/**
256-
* @return bool
256+
* @tentative-return-type
257257
* @alias xmlwriter_write_comment
258258
*/
259-
public function writeComment(string $content) {}
259+
public function writeComment(string $content): bool {}
260260

261261
/**
262-
* @return bool
262+
* @tentative-return-type
263263
* @alias xmlwriter_start_dtd
264264
*/
265-
public function startDtd(string $qualifiedName, ?string $publicId = null, ?string $systemId = null) {}
265+
public function startDtd(string $qualifiedName, ?string $publicId = null, ?string $systemId = null): bool {}
266266

267267
/**
268-
* @return bool
268+
* @tentative-return-type
269269
* @alias xmlwriter_end_dtd
270270
*/
271-
public function endDtd() {}
271+
public function endDtd(): bool {}
272272

273273
/**
274-
* @return bool
274+
* @tentative-return-type
275275
* @alias xmlwriter_write_dtd
276276
*/
277-
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null) {}
277+
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null): bool {}
278278

279279
/**
280-
* @return bool
280+
* @tentative-return-type
281281
* @alias xmlwriter_start_dtd_element
282282
*/
283-
public function startDtdElement(string $qualifiedName) {}
283+
public function startDtdElement(string $qualifiedName): bool {}
284284

285285
/**
286-
* @return bool
286+
* @tentative-return-type
287287
* @alias xmlwriter_end_dtd_element
288288
*/
289-
public function endDtdElement() {}
289+
public function endDtdElement(): bool {}
290290

291291
/**
292-
* @return bool
292+
* @tentative-return-type
293293
* @alias xmlwriter_write_dtd_element
294294
*/
295-
public function writeDtdElement(string $name, string $content) {}
295+
public function writeDtdElement(string $name, string $content): bool {}
296296

297297
/**
298-
* @return bool
298+
* @tentative-return-type
299299
* @alias xmlwriter_start_dtd_attlist
300300
*/
301-
public function startDtdAttlist(string $name) {}
301+
public function startDtdAttlist(string $name): bool {}
302302

303303
/**
304-
* @return bool
304+
* @tentative-return-type
305305
* @alias xmlwriter_end_dtd_attlist
306306
*/
307-
public function endDtdAttlist() {}
307+
public function endDtdAttlist(): bool {}
308308

309309
/**
310-
* @return bool
310+
* @tentative-return-type
311311
* @alias xmlwriter_write_dtd_attlist
312312
*/
313-
public function writeDtdAttlist(string $name, string $content) {}
313+
public function writeDtdAttlist(string $name, string $content): bool {}
314314

315315
/**
316-
* @return bool
316+
* @tentative-return-type
317317
* @alias xmlwriter_start_dtd_entity
318318
*/
319-
public function startDtdEntity(string $name, bool $isParam) {}
319+
public function startDtdEntity(string $name, bool $isParam): bool {}
320320

321321
/**
322-
* @return bool
322+
* @tentative-return-type
323323
* @alias xmlwriter_end_dtd_entity
324324
*/
325-
public function endDtdEntity() {}
325+
public function endDtdEntity(): bool {}
326326

327327
/**
328-
* @return bool
328+
* @tentative-return-type
329329
* @alias xmlwriter_write_dtd_entity
330330
*/
331-
public function writeDtdEntity(string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null) {}
331+
public function writeDtdEntity(string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null): bool {}
332332

333333
/**
334-
* @return string
334+
* @tentative-return-type
335335
* @alias xmlwriter_output_memory
336336
*/
337-
public function outputMemory(bool $flush = true) {}
337+
public function outputMemory(bool $flush = true): string {}
338338

339339
/**
340-
* @return string|int
340+
* @tentative-return-type
341341
* @alias xmlwriter_flush
342342
*/
343-
public function flush(bool $empty = true) {}
343+
public function flush(bool $empty = true): string|int {}
344344
}

0 commit comments

Comments
 (0)