mteu / sbom-parser
Type-safe parser for CycloneDX Software Bill of Materials (SBOM) JSON files
Requires
- php: ~8.3.0 || ~8.4.0 || ~8.5.0
- cuyz/valinor: ^2.0
Requires (Dev)
- armin/editorconfig-cli: ^2.1
- cyclonedx/cyclonedx-php-composer: ^6.0
- ergebnis/composer-normalize: ^2.28
- friendsofphp/php-cs-fixer: ^3.8
- justinrainbow/json-schema: ^6.8
- mteu/zealous-stan: ^0.6.3
- phpstan/extension-installer: *
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpcov: ^10.0 || ^11.0.0
- phpunit/phpunit: ^11.5 || ^12.1
- shipmonk/composer-dependency-analyser: *
- dev-main
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- dev-renovate/phpunit-phpunit-12.5.x-lockfile
- dev-task/move-severity-to-enumeration
- dev-feature/add-path-allowlist
- dev-feature/limit-max-nodes
- dev-feature/parser-options
- dev-docs/update-parser-docs
- dev-feature/make-parser-max-files-size-configurable
- dev-bugfix/replace-sbom-path-validation
- dev-task/replace-zealous-stan
- dev-task/use-composer-purls
- dev-feature/improve-bom-traversal
- dev-task/add-distrinct-errorcodes
- dev-docs/clarify-docs
- dev-renovate/lock-file-maintenance
This package is auto-updated.
Last update: 2026-05-13 05:16:39 UTC
README
CycloneDX SBOM Parser for PHP
CycloneDX SBOM (Software Bill of Materials) parser for PHP 8.3+. Supports CycloneDX 1.4+ specifications including components, vulnerabilities, and metadata with full immutable entity design using Valinor for type mapping.
Note
The CycloneDX ecosystem provides an official PHP library
(cyclonedx/cyclonedx-library)
and a Composer plugin for
generating SBOMs. These tools are designed to produce BOMs as part of your build
pipeline — not for consuming them in application code.
This package aims to fill a different gap: Reading and inspecting existing SBOM files.
If your application needs to parse a CycloneDX SBOM and work with its data — querying components, checking vulnerabilities, reading metadata — you need a lightweight, read-only library with clean, type-safe objects. That is what this package aims to provide.
⚡️ Quick Start
use mteu\SbomParser\Parser\CycloneDxParser; $parser = new CycloneDxParser(); $bom = $parser->parseFromFile('/path/to/sbom.json'); // Access components and vulnerabilities $components = $bom->getAllComponents(); $vulnerabilities = $bom->vulnerabilities;
See detailed documentation for complete usage examples and API reference.
🤝 Contributing
Contributions are very welcome! Please have a look at the Contribution Guide. It lays out the workflow of submitting new features or bugfixes.
🔒 Security
Please refer to the security policy if you discover a security vulnerability in this extension. Be warned, though. I cannot afford bounty.
⭐ License
This extension is licensed under the GPL-3.0-or-later license.
💬 Support
For issues and feature requests, please use the GitHub issue tracker.