From a0c1e1f5c7c43ced17fac8b68f4ab554ce521b1c Mon Sep 17 00:00:00 2001 From: Samantha Nguyen Date: Thu, 20 Feb 2025 00:07:56 -0600 Subject: [PATCH] release: v1.0.1 minor documentation updates + fixes --- CHANGELOG.md | 7 +++++++ src/Encoding.php | 2 ++ src/ErrorCode.php | 2 ++ src/Option.php | 2 ++ src/XmlNativeParser.php | 10 ++++++---- 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4952453 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## v1.0.1 (2025-02-20) + - Minor documentation updates and fixes. + +## v1.0.0 (2025-02-20) + - Initial release of `neoncitylights/xml` library. diff --git a/src/Encoding.php b/src/Encoding.php index 0ab8438..e3c8feb 100644 --- a/src/Encoding.php +++ b/src/Encoding.php @@ -3,6 +3,8 @@ namespace Neoncitylights\Xml; /** + * A text encoding of an XML document + * * @see https://www.php.net/manual/en/xml.encoding.php */ enum Encoding: string { diff --git a/src/ErrorCode.php b/src/ErrorCode.php index 0b0de92..238b465 100644 --- a/src/ErrorCode.php +++ b/src/ErrorCode.php @@ -3,6 +3,8 @@ namespace Neoncitylights\Xml; /** + * An error code returned from an XML parser + * * @see https://www.php.net/manual/en/xml.constants.php */ enum ErrorCode: int { diff --git a/src/Option.php b/src/Option.php index a0cbb19..e6ac2a9 100644 --- a/src/Option.php +++ b/src/Option.php @@ -3,6 +3,8 @@ namespace Neoncitylights\Xml; /** + * Options for configuring an XML parser + * * @see https://www.php.net/manual/en/xml.constants.php */ enum Option: int { diff --git a/src/XmlNativeParser.php b/src/XmlNativeParser.php index 6228fd1..3936e83 100644 --- a/src/XmlNativeParser.php +++ b/src/XmlNativeParser.php @@ -4,6 +4,9 @@ use XMLParser; +/** + * A lightweight wrapper around PHP's native XML API. + */ class XmlNativeParser { public readonly XMLParser $parser; @@ -28,7 +31,6 @@ public static function new( ?Encoding $encoding = null ): self { */ public static function newWithNamespace( ?Encoding $encoding = null, - ?string $separator = ':', ): self { return new XmlNativeParser( \xml_parser_create_ns( @@ -135,7 +137,7 @@ public function getCaseFolding(): bool { /** * Retrieve the parser option value of - * `XML_OPTION_SKIP_TAG_START`. + * `XML_OPTION_SKIP_TAGSTART`. */ public function getSkipTagStart(): int { return $this->getOption( Option::SkipTagStart ); @@ -180,7 +182,7 @@ public function setCaseFolding( bool $value ): bool { } /** - * Sets the parser option of `XML_OPTION_SKIP_WHITE`. + * Sets the parser option of `XML_OPTION_SKIP_TAGSTART`. * * @return bool Returns a boolean for whether or not * setting the option was a success. @@ -307,7 +309,7 @@ public function onProcessingInstruction( callable|null $handler ): true { * * Internally calls `xml_set_start_namespace_decl_handler()`. * - * @param (callable(XmlDocumentParser, string): void)|null $handler + * @param (callable(string): void)|null $handler * @return true Always returns true */ public function onStartNamespaceDecl( callable|null $handler ): true {