Skip to content

# PHP XML Util 6.0 - PR Description#7

Merged
byjg merged 12 commits intomasterfrom
6.0
Nov 19, 2025
Merged

# PHP XML Util 6.0 - PR Description#7
byjg merged 12 commits intomasterfrom
6.0

Conversation

@byjg
Copy link
Owner

@byjg byjg commented Mar 23, 2025

Major Changes

This PR introduces version 6.0 of the PHP XML Util library with several important improvements and breaking changes.

New Features

  1. Enhanced XML File Handling
  • New dedicated File class API for reading and writing XML files
  • Improved handling of file errors with more descriptive exceptions
  • Added clear examples for file operations in documentation
  1. XML Schema Validation
  • New validation capabilities for XML documents against XSD schemas
  • Support for both exception-based validation and error collection
  • Comprehensive documentation with examples
  1. Improved EntityParser
  • Refactored with better code organization and documentation
  • Added support for anonymous classes in XML serialization
  • Enhanced error handling for invalid XML data
  • More consistent type handling
  1. More Flexible Type Handling
  • Updated signature of key methods to handle nullable parameters appropriately
  • Better null-safety throughout the codebase
  1. Modern PHP Support
  • Added support for PHP 8.4

Breaking Changes

  1. Dependency Updates
  • Major: Updated requirement for byjg/serializer from ^5.0 to ^6.0
  • Updated PHPUnit from ^9.6 to ^10.5|^11.5
  • Updated Psalm from ^5.20 to ^5.9|^6.2
  1. Method Signature Changes
  • Several method signatures have been updated with union types:

    • File::getContents(): Return type changed from string to string|bool
    • XmlDocument::fixXmlHeader(): Parameter type changed from string to string|bool
    • XmlDocument::removeBom(): Parameter and return types updated
    • XmlNode::toArray(): Parameter type updated to use nullable syntax
    • XmlNode::_toString(): Parameter type updated to use nullable syntax
    • EntityParser::arrayToXml(): Parameter type updated to use nullable syntax
  1. Error Handling
  • More strict error checking and exception throwing for invalid XML content
  • Changed error handling approach in several methods

Compatibility Notes

  • Requires PHP 8.1 or higher (now supports up to PHP 8.4)
  • Projects using byjg/serializer 5.x must upgrade to 6.x
  • Code that depends on specific parameter types or return types may need updates
  • Applications relying on the previous error handling behavior may need adjustments

This update focuses on modernizing the library with the latest PHP features while improving code quality, maintainability, and adding new functionality for XML handling and validation.

Description by Korbit AI

What change is being made?

Update the PHP XML Util library to version 6.0, adding support for PHP 8.4, enhancing documentation, and improving the API for better XML document manipulation, querying, and validation.

Why are these changes being made?

These updates introduce new features such as powerful XPath querying, enhanced documentation with clear examples and API usage, improved error handling for file operations, support for PHP 8.4, and additional flexibility in XML entity and property handling. The improvements aim to make XML operations in PHP both easier and more intuitive with a more comprehensive feature set and a user-friendly API.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

byjg added 7 commits December 11, 2024 10:48
This change clarifies that the setUp method intentionally overrides a parent method. It improves code readability and ensures adherence to annotations for better maintenance.
Restored README formatting, added VSCode launch config for debugging, and adjusted PHPUnit and Psalm versions. Updated GitHub Actions workflow for consistent testing steps and aligned PHPUnit schema URL in config files. Removed unnecessary comments from FUNDING.yml.
Enhance documentation for XmlUtil by adding examples and methods for querying, creating, and cleaning XML documents. Introduce advanced features such as namespace handling, node manipulation, content removal, and attribute mapping for improved control over XML processing.
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Readability Imprecise return type declaration ▹ view
Performance Inefficient BOM removal using regex ▹ view
Performance Inefficient XML header detection ▹ view
Documentation Ambiguous return type documentation ▹ view
Files scanned
File Path Reviewed
src/File.php
src/Attributes/XmlEntity.php
src/XmlDocument.php
src/XmlNode.php
src/EntityParser.php

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Documentation
Logging
Error Handling
Readability
Design
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

@byjg byjg merged commit b98fcfc into master Nov 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant