wyrihaximus/compress-contracts
PHP interfaces for compression. Defines small CompressorInterface and DecompressorInterface contracts so you can swap gzip, zlib, or custom implementations without coupling code to a specific library. Great for ReactPHP and other async projects needing clean, testable compression abstractions.
wyrihaximus/compress-contracts is a marker interface (no methods), so its only product value is as a shared type token: it lets our code ask "is this object a compressor?" without binding to a concrete implementation. That is an architectural decision, not a user-facing one. Adopt it only if the roadmap actually contains two or more compressor implementations or an extension point where third parties inject one.Adopt when all of these hold:
require).Look elsewhere (or inline it) when any of these hold:
interface Compress {} in your own package.compress(): string / decompress(), this package solves nothing; look at concrete implementations such as wyrihaximus/compress or PSR-style abstractions.composer.json constraints against your runtime before committing; validate rather than assume, since documentation here is essentially the description line.For executives (30 seconds): This is a free, MIT-licensed, single-interface PHP package that acts as a shared label for "this thing compresses." It is not a feature; it is a naming convention that lets different parts of our code and third-party extensions agree on terminology. Cost is effectively zero and so is standalone value. Recommendation: do not adopt as a standalone initiative. Fold it into a decision only if we commit to a broader pluggable-compression architecture, where it becomes the cheap, low-risk contract layer.
For engineering (60 seconds): wyrihaximus/compress-contracts defines a method-less marker interface, so it enforces identity, never behavior. That means it can gate capability checks and DI wiring but cannot standardize a compression API. It is a 2020 release with 0 dependents and 2 stars, so we should treat it as frozen but stable: expect no churn, get no support, and pin the version. If we are already in the maintainer's async ecosystem, take it for interop. If not, write the interface in our own namespace, keep the dependency graph and SBOM clean, and revisit only if we need ecosystem interop.
Ask: Confirm whether pluggable compression with external implementers is on the roadmap this year. If yes, prototype with the contract and validate PHP constraint compatibility in the same spike. If no, decline and record the rationale so the same 30-minute evaluation is not repeated next quarter.
How can I help you explore Laravel packages today?