Skip to content

Improve parameter names in ext/xmlwriter #6202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions ext/xmlwriter/php_xmlwriter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,85 @@ function xmlwriter_open_uri(string $uri): XMLWriter|false {}

function xmlwriter_open_memory(): XMLWriter|false {}

function xmlwriter_set_indent(XMLWriter $xmlwriter, bool $indent): bool {}
function xmlwriter_set_indent(XMLWriter $writer, bool $enable): bool {}

function xmlwriter_set_indent_string(XMLWriter $xmlwriter, string $indentString): bool {}
function xmlwriter_set_indent_string(XMLWriter $writer, string $indentation): bool {}

function xmlwriter_start_comment(XMLWriter $xmlwriter): bool {}
function xmlwriter_start_comment(XMLWriter $writer): bool {}

function xmlwriter_end_comment(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_comment(XMLWriter $writer): bool {}

function xmlwriter_start_attribute(XMLWriter $xmlwriter, string $name): bool {}
function xmlwriter_start_attribute(XMLWriter $writer, string $name): bool {}

function xmlwriter_end_attribute(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_attribute(XMLWriter $writer): bool {}

function xmlwriter_write_attribute(XMLWriter $xmlwriter, string $name, string $value): bool {}
function xmlwriter_write_attribute(XMLWriter $writer, string $name, string $value): bool {}

function xmlwriter_start_attribute_ns(XMLWriter $xmlwriter, ?string $prefix, string $name, ?string $uri): bool {}
function xmlwriter_start_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {}

function xmlwriter_write_attribute_ns(XMLWriter $xmlwriter, ?string $prefix, string $name, ?string $uri, string $content): bool {}
function xmlwriter_write_attribute_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, string $value): bool {}

function xmlwriter_start_element(XMLWriter $xmlwriter, string $name): bool {}
function xmlwriter_start_element(XMLWriter $writer, string $name): bool {}

function xmlwriter_end_element(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_element(XMLWriter $writer): bool {}

function xmlwriter_full_end_element(XMLWriter $xmlwriter): bool {}
function xmlwriter_full_end_element(XMLWriter $writer): bool {}

function xmlwriter_start_element_ns(XMLWriter $xmlwriter, ?string $prefix, string $name, ?string $uri): bool {}
function xmlwriter_start_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri): bool {}

function xmlwriter_write_element(XMLWriter $xmlwriter, string $name, ?string $content = null): bool {}
function xmlwriter_write_element(XMLWriter $writer, string $name, ?string $content = null): bool {}
Copy link
Member

@kocsismate kocsismate Sep 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I see why content was used for attributes! While it is's a good term for describing what an element contains, it's not the best in case of attributes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your preference for $value for attributes. I would be OK with using $value for attributes while keeping $content elsewhere. Are you OK with that as well @nikic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm okay with making that distinction.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I just pushed these last few changes.


function xmlwriter_write_element_ns(XMLWriter $xmlwriter, ?string $prefix, string $name, ?string $uri, ?string $content = null): bool {}
function xmlwriter_write_element_ns(XMLWriter $writer, ?string $prefix, string $name, ?string $uri, ?string $content = null): bool {}

function xmlwriter_start_pi(XMLWriter $xmlwriter, string $target): bool {}
function xmlwriter_start_pi(XMLWriter $writer, string $target): bool {}

function xmlwriter_end_pi(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_pi(XMLWriter $writer): bool {}

function xmlwriter_write_pi(XMLWriter $xmlwriter, string $target, string $content): bool {}
function xmlwriter_write_pi(XMLWriter $writer, string $target, string $content): bool {}

function xmlwriter_start_cdata(XMLWriter $xmlwriter): bool {}
function xmlwriter_start_cdata(XMLWriter $writer): bool {}

function xmlwriter_end_cdata(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_cdata(XMLWriter $writer): bool {}

function xmlwriter_write_cdata(XMLWriter $xmlwriter, string $content): bool {}
function xmlwriter_write_cdata(XMLWriter $writer, string $content): bool {}

function xmlwriter_text(XMLWriter $xmlwriter, string $content): bool {}
function xmlwriter_text(XMLWriter $writer, string $content): bool {}

function xmlwriter_write_raw(XMLWriter $xmlwriter, string $content): bool {}
function xmlwriter_write_raw(XMLWriter $writer, string $content): bool {}

function xmlwriter_start_document(XMLWriter $xmlwriter, ?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}
function xmlwriter_start_document(XMLWriter $writer, ?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool {}

function xmlwriter_end_document(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_document(XMLWriter $writer): bool {}

function xmlwriter_write_comment(XMLWriter $xmlwriter, string $content): bool {}
function xmlwriter_write_comment(XMLWriter $writer, string $content): bool {}

function xmlwriter_start_dtd(XMLWriter $xmlwriter, string $qualifiedName, ?string $publicId = null, ?string $systemId = null): bool {}
function xmlwriter_start_dtd(XMLWriter $writer, string $qualifiedName, ?string $publicId = null, ?string $systemId = null): bool {}

function xmlwriter_end_dtd(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_dtd(XMLWriter $writer): bool {}

function xmlwriter_write_dtd(XMLWriter $xmlwriter, string $name, ?string $publicId = null, ?string $systemId = null, ?string $subset = null): bool {}
function xmlwriter_write_dtd(XMLWriter $writer, string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null): bool {}

function xmlwriter_start_dtd_element(XMLWriter $xmlwriter, string $qualifiedName): bool {}
function xmlwriter_start_dtd_element(XMLWriter $writer, string $qualifiedName): bool {}

function xmlwriter_end_dtd_element(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_dtd_element(XMLWriter $writer): bool {}

function xmlwriter_write_dtd_element(XMLWriter $xmlwriter, string $name, string $content): bool {}
function xmlwriter_write_dtd_element(XMLWriter $writer, string $name, string $content): bool {}

function xmlwriter_start_dtd_attlist(XMLWriter $xmlwriter, string $name): bool {}
function xmlwriter_start_dtd_attlist(XMLWriter $writer, string $name): bool {}

function xmlwriter_end_dtd_attlist(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_dtd_attlist(XMLWriter $writer): bool {}

function xmlwriter_write_dtd_attlist(XMLWriter $xmlwriter, string $name, string $content): bool {}
function xmlwriter_write_dtd_attlist(XMLWriter $writer, string $name, string $content): bool {}

function xmlwriter_start_dtd_entity(XMLWriter $xmlwriter, string $name, bool $isparam): bool {}
function xmlwriter_start_dtd_entity(XMLWriter $writer, string $name, bool $isParam): bool {}

function xmlwriter_end_dtd_entity(XMLWriter $xmlwriter): bool {}
function xmlwriter_end_dtd_entity(XMLWriter $writer): bool {}

function xmlwriter_write_dtd_entity(XMLWriter $xmlwriter, string $name, string $content, bool $isparam = false, ?string $publicId = null, ?string $systemId = null, ?string $ndataid = null): bool {}
function xmlwriter_write_dtd_entity(XMLWriter $writer, string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null): bool {}

function xmlwriter_output_memory(XMLWriter $xmlwriter, bool $flush = true): string {}
function xmlwriter_output_memory(XMLWriter $writer, bool $flush = true): string {}

function xmlwriter_flush(XMLWriter $xmlwriter, bool $empty = true): string|int {}
function xmlwriter_flush(XMLWriter $writer, bool $empty = true): string|int {}

class XMLWriter
{
Expand All @@ -95,10 +95,10 @@ public function openUri(string $uri): bool {}
public function openMemory(): bool {}

/** @alias xmlwriter_set_indent */
public function setIndent(bool $indent): bool {}
public function setIndent(bool $enable): bool {}

/** @alias xmlwriter_set_indent_string */
public function setIndentString(string $indentString): bool {}
public function setIndentString(string $indentation): bool {}

/** @alias xmlwriter_start_comment */
public function startComment(): bool {}
Expand All @@ -119,7 +119,7 @@ public function writeAttribute(string $name, string $value): bool {}
public function startAttributeNs(?string $prefix, string $name, ?string $uri): bool {}

/** @alias xmlwriter_write_attribute_ns */
public function writeAttributeNs(?string $prefix, string $name, ?string $uri, string $content): bool {}
public function writeAttributeNs(?string $prefix, string $name, ?string $uri, string $value): bool {}

/** @alias xmlwriter_start_element */
public function startElement(string $name): bool {}
Expand Down Expand Up @@ -179,7 +179,7 @@ public function startDtd(string $qualifiedName, ?string $publicId = null, ?strin
public function endDtd(): bool {}

/** @alias xmlwriter_write_dtd */
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $subset = null): bool {}
public function writeDtd(string $name, ?string $publicId = null, ?string $systemId = null, ?string $content = null): bool {}

/** @alias xmlwriter_start_dtd_element */
public function startDtdElement(string $qualifiedName): bool {}
Expand All @@ -200,13 +200,13 @@ public function endDtdAttlist(): bool {}
public function writeDtdAttlist(string $name, string $content): bool {}

/** @alias xmlwriter_start_dtd_entity */
public function startDtdEntity(string $name, bool $isparam): bool {}
public function startDtdEntity(string $name, bool $isParam): bool {}

/** @alias xmlwriter_end_dtd_entity */
public function endDtdEntity(): bool {}

/** @alias xmlwriter_write_dtd_entity */
public function writeDtdEntity(string $name, string $content, bool $isparam = false, ?string $publicId = null, ?string $systemId = null, ?string $ndataid = null): bool {}
public function writeDtdEntity(string $name, string $content, bool $isParam = false, ?string $publicId = null, ?string $systemId = null, ?string $notationData = null): bool {}

/** @alias xmlwriter_output_memory */
public function outputMemory(bool $flush = true): string {}
Expand Down
Loading