andrey-helldar/xml-core
A lightweight PHP library providing core XML utilities, serving as a shared foundation for Helldar's XML-related packages. Keeps common XML handling logic simple and reusable across PHP and Laravel projects.
composer require andrey-helldar/xml-core and note the resolved version — the last tagged release is 2.4.0 (Feb 2025) and the repository is archived. Pin it (^2.4 or exactly 2.4.0) and commit composer.lock.php artisan vendor:publish expecting tags, you'll find none — that's by design, not a misconfiguration.src/ (it's small enough to read end to end in one sitting) → tests/. With an archived, lightly-starred package, the test suite is the real documentation; it shows the exact input/output shapes and the edge cases the maintainer cared about.composer.json. If you're on Laravel 12 you're already at PHP 8.2+, so a conflict here is unusual; if composer require fails, it's almost certainly a transitive constraint, not this package.path repository and maintain it yourself. Decide that up front rather than at the first bug.App\Xml\XmlSerializer with toXml(array $data): string and toArray(string $xml): array — bound in a service provider. The package's concrete classes never appear in a controller, job, or model. This is the single highest-value pattern here because it makes the archive status irrelevant: swapping to spatie/array-to-xml or a hand-rolled DOMDocument later becomes a one-file change.model → plain array DTO → XML and, on the way in, XML → array → validated DTO. Keep the "array shape that the XML layer likes" (attributes, repeated nodes, CDATA) out of your domain layer.config/xml.php yourself for root element name, encoding, CDATA behaviour, and date formatting, and read it from your adapter. This gives you one place to change conventions and a clean seam for tests.tests/fixtures/ and either compare normalized strings (strip insignificant whitespace) or — better — assert round-trips: build from a known array, parse it back, assert the array is unchanged. That catches escaping and empty-element regressions without pinning you to formatting details.composer require and let Composer pick a compatible pair — a split resolution is the most likely source of an unsatisfiable graph or a runtime API mismatch.repositories entry with {"type": "path", "url": "packages/xml-core"} and vendor the source. You get local fixes, code review, and a clear diff against upstream without waiting on an archived maintainer.2.4.0 reads as "added Laravel 12 support," but the substantive content is a constraint relaxation plus a bot-authored LICENSE year bump. That does not make this a Laravel integration package; it confirms the release pipeline runs, nothing more.xmlns attributes, downstream SOAP/partner endpoints will reject the payload even though it "looks right." When namespaces matter, build the final string with DOMDocument and use the package only for the data-shape step.DOMDocument/XMLReader configured safely first, or reject on <!DOCTYPE before handing it to the package.XMLReader and use the package per-record instead of per-file.libxml_use_internal_errors(true), drain libxml_get_errors() in your adapter, and translate them into a domain exception so failures are debuggable.config/xml.php, and fixtures. Avoid subclassing the package's concrete classes or reflecting into internals — there is no indication internals were ever treated as public API, and an archived project will never fix a subclassing break.DOMDocument/SimpleXML is zero dependencies; spatie/array-to-xml and symfony/serializer's XmlEncoder are actively maintained. Choose this package when you specifically value its small, focused API or its role as the base of the author's other XML packages — not by default.How can I help you explore Laravel packages today?