mcstreetguy/composer-parser
A PHP library for parsing composer.json and composer.lock files into structured, object-oriented data. It exposes package metadata, dependencies, version constraints, and lockfile contents, making Composer projects easy to inspect programmatically.
composer.json / composer.lock" layer. It replaces a few days of json_decode plumbing plus a schema model with a small MIT-licensed dependency — a cheap way to validate a feature before committing engineering time.Adopt it when all of the following hold:
composer.json/composer.lock files without heavy reliance on Composer 2-era features, plugin-generated structures, or exotic repositories/extra blocks.Look elsewhere when:
composer's own APIs, composer/semver, or direct JSON parsing with a schema you control.json_decode() plus a validation layer is smaller and has no supply-chain cost.To executives: This is a small, free, permissively licensed building block that lets us prototype dependency-visibility features — license audits, version sprawl reports, upgrade planning — in days rather than weeks. It is not a strategic platform bet: it is unmaintained since 2019 with essentially no user base, so I recommend using it only for internal prototypes, with a clear decision gate before we would ever ship it in a customer-facing path. Worst case, we vendor the ~small codebase and own it; best case, it saves us a sprint of plumbing and tells us whether the feature is worth funding.
To engineering: An OOP wrapper over Composer manifest parsing — objects for packages, requirements, and lock entries instead of hand-rolled array traversal. MIT, no transitive baggage of note, easy to vendor. Caveats you should weigh: it predates Composer 2 and PHP 8, has no dependents to shake out bugs, and has no release cadence. If we adopt it, treat it as a pinned internal dependency, wrap it behind our own interface so it can be swapped, and budget a fork if we hit schema gaps.
How can I help you explore Laravel packages today?